Last active
December 29, 2015 14:09
-
-
Save M1ke/7682017 to your computer and use it in GitHub Desktop.
Generate a random number within a range
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 | |
# Generate a random number within a range | |
from=$1 | |
to=$2 | |
$(( ( RANDOM % $to ) + $from )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment