Skip to content

Instantly share code, notes, and snippets.

@bogovicj
Created April 7, 2020 16:43
Show Gist options
  • Save bogovicj/5b14e5a909eb3bccbf86e7376cecba3a to your computer and use it in GitHub Desktop.
Save bogovicj/5b14e5a909eb3bccbf86e7376cecba3a to your computer and use it in GitHub Desktop.
bogo - bogosort for everything
#!/bin/bash
# bogo - like bogosort, but for everything
VERBOSE=""
while getopts "v" OPT
do
case $OPT in
v) # verbose
VERBOSE="1"
shift
;;
esac
done
exe="$1"
shift
T=$(($RANDOM % $#))
if [ $VERBOSE ]; then
echo $T
fi
sleep $T
$exe $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment