mercredi 6 février 2019

Generate random number except values in bash

I want to generate a random nunmber between some values but except some values.

I have this:

shuf -i 1-9 -n 1

Or this:

$(( ( RANDOM % 10 )  + 1 ))

But i want to exclude the number 3 and the number 8, for example.




Aucun commentaire:

Enregistrer un commentaire