jeudi 20 avril 2017

Bash Random Number between 1 and 100 and how to specify as a command line argument the upper and lower limit of the random number

If I run ./random.sh 10 45, it would only return random numbers between 10 and 45.

I am able to produce the random number using

randomNumber=$((1 + RANDOM % 100))

but now how can I allow user to specify upper and lower limit of random number?




Aucun commentaire:

Enregistrer un commentaire