On 0, Soren Orel <soren.o...@gmail.com> 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 debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org