Stunts
September 29th, 2010, 10:51 AM
I'm not sure this is the adequate place for this question, but here it goes.
I'm trying to use the $RANDOM function in a bash script however I'm getting strange results using ubuntu.
Here is the script:
RANDOM=$$
echo $RANDOM$RANDOM $RANDOM$RANDOM $RANDOM$RANDOM
Using ArchLinux I get the expected behaviour (for example):
380520935 19553849 114661392
However, using Ubuntu 10.04 server I get:
71507150 71507150 71507150
It's always the same. Why does this happen? And what can I do to make it run as expected?
Is this a bug or a feature?
Thank you in advance.
I'm trying to use the $RANDOM function in a bash script however I'm getting strange results using ubuntu.
Here is the script:
RANDOM=$$
echo $RANDOM$RANDOM $RANDOM$RANDOM $RANDOM$RANDOM
Using ArchLinux I get the expected behaviour (for example):
380520935 19553849 114661392
However, using Ubuntu 10.04 server I get:
71507150 71507150 71507150
It's always the same. Why does this happen? And what can I do to make it run as expected?
Is this a bug or a feature?
Thank you in advance.