[OLUG] quick question

Dave Burchell burchell at inetnebr.com
Wed Feb 23 14:32:58 UTC 2000


root says:
> 
> What would be the best way to come up with a random number in a shell
> script? It doesn't even need to be truely random, either, just something
> that isn't always the same. It'll be running on HP/UX as well as Linux.

Two ideas:

echo $RANDOM

perl -e 'srand(); print int(rand(20)) . "\n";'

-- 
Dave Burchell                                          40.49'N, 96.41'W
Free your mind and your software will follow.              402-467-1619
http://incolor.inetnebr.com/burchell/                  burchell at acm.org     

-------------------------------------------------------------------------
Sent by OLUG Mailing list Manager, run by ezmlm.  http://olug.bstc.net/ 
To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net` 



More information about the OLUG mailing list