Created
June 21, 2016 09:06
-
-
Save holmeszyx/0780fba3e3cc37e43bef56339762a06a to your computer and use it in GitHub Desktop.
Create random number with bash.
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 | |
c=$# | |
#echo $# | |
if [[ ${c} -gt 0 ]]; then | |
echo "$RANDOM * $1" | bc | |
else | |
echo $RANDOM | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment