-
-
Save bogovicj/5b14e5a909eb3bccbf86e7376cecba3a to your computer and use it in GitHub Desktop.
bogo - bogosort for everything
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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