lundi 28 août 2017

Why am I getting the same value for echo $RANDOM for all iterations in bash?

bash script:

for c in $( seq 1 10) 
do
   echo "random value #$c:$(echo "$RANDOM")" 
done

output:

random value #1:20892
random value #2:20892
random value #3:20892
random value #4:20892
random value #5:20892
random value #6:20892
random value #7:20892
random value #8:20892
random value #9:20892
random value #10:20892



Aucun commentaire:

Enregistrer un commentaire