Last active
January 25, 2021 00:21
-
-
Save CTimmerman/bc0f392ac6b5c10c690d318f76fde674 to your computer and use it in GitHub Desktop.
[Some](https://www.redpill-linpro.com/sysadvent/2016/12/13/bash_random_numbers.html) Bash documentation [sucks](https://linux.die.net/man/1/bash#Random).
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
echo -e '"$RANDOM returns a pseudorandom integer between 0 and 32767" - False.' | |
(( r = 1 )) | |
until ((r <= 0 || r >= 32767)) | |
do | |
(( r = $RANDOM )) | |
done | |
echo -e "$r.\nSemicolons replace newlines:" | |
(( r = 5)); while ((r < 10)); do echo $r; (( r ++ )); done | |
echo "Ranges include end:" | |
for value in {1..5} | |
do | |
echo $value | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment