Pipe the numbers into sort & uniq. You will get than less since the duplicates will be deleted, but maybe you have another loop checking the count of numbers and generate some more. Maybe there is already some nice random function in
Perl.
Also these lines
Quote:
number=$[ [$RANDOM % 20 ] + 1 ]
"echo $number"
|
did not work for me. I had to change them to
Code:
number=$(( ( $RANDOM % 20 ) + 1 ))
echo "$number"