Created
November 23, 2020 18:42
-
-
Save magickatt/b45a29765d0682ec6faa8e7279994d38 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Random number between 1 and 10 | |
WAIT=`shuf -i 1-10 -n 1` | |
# Subtract 1 from the random number, check if it is now 0 | |
is_random_number_zero () { | |
let WAIT=WAIT-1 | |
return $([[ "$WAIT" -eq "0" ]]) | |
} | |
# Check if random number is 0 then sleep for 1 second, loop | |
until is_random_number_zero; do | |
sleep 1s; | |
echo $WAIT | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment