Bash
Bash specific things, see the Linux Cheatsheet for more.
#!/bin/bash
MAX=32768
MIN=1
SLEEP=$((RANDOM % MAX + MIN))
echo "Waiting $SLEEP second(s)"
sleep $SLEEP
You can also use SRANDOM
in Bash >= 5.1 for a stronger random.
set +o history
Bash specific things, see the Linux Cheatsheet for more.
#!/bin/bash
MAX=32768
MIN=1
SLEEP=$((RANDOM % MAX + MIN))
echo "Waiting $SLEEP second(s)"
sleep $SLEEP
You can also use SRANDOM
in Bash >= 5.1 for a stronger random.
set +o history