On 0, Soren Orel <[email protected]> wrote: > I know I could generate numbers like: 0; 1; 2 > with: > $[ ( $RANDOM % 3 ) + 0 ] > But how could I generate numbers like: 0; 1; 2; -1; -2; etc? So > negative+positive numbers too + zero > thank you
echo $[ ($RANDOM % 5 ) -2 ]
That would generate -2 through 2.
--
http://fuzzydev.org/~pobega
http://identi.ca/pobega
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

