Created
November 6, 2020 11:00
-
-
Save tomaskavalek/bab3dd4a09b4f955a3bbba040e93cee0 to your computer and use it in GitHub Desktop.
Bash – Get random number in interval
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 | |
# Get random number 0–5 | |
local RANDOM_NUMBER=$(grep -m1 -ao '[0-5]' /dev/urandom | head -n1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment