Skip to content

Instantly share code, notes, and snippets.

@holmeszyx
Created June 21, 2016 09:06
Show Gist options
  • Save holmeszyx/0780fba3e3cc37e43bef56339762a06a to your computer and use it in GitHub Desktop.
Save holmeszyx/0780fba3e3cc37e43bef56339762a06a to your computer and use it in GitHub Desktop.
Create random number with bash.
#!/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