The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
TA08-137A: Debian/Ubuntu OpenSSL Random Number Generator Vulnerability iBot Security Advisories (RSS) 0 05-16-2008 11:50 AM
Random number generation in ksh mervin2006 UNIX for Dummies Questions & Answers 2 04-26-2007 11:02 PM
Random number generation tej.buch High Level Programming 1 02-13-2006 06:07 AM
random number logic -- issue asutoshch High Level Programming 1 05-09-2003 08:07 AM
How to generate a random number? MacMonster High Level Programming 2 10-15-2001 09:35 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-09-2008
Registered User
 

Join Date: Nov 2007
Posts: 8
Does Solaris have a random number generator?

I am trying to find a way to generate random numbers within a shell script.
Does Solaris have a utility that will generate random numbers?

Thanks in advance.
B
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-09-2008
Registered User
 

Join Date: Jul 2007
Posts: 93
for sh/ksh/bash
Code:
 print $RANDOM
Reply With Quote
  #3 (permalink)  
Old 04-09-2008
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,495
It really depends on how random you want the data to be, $RANDOM in a tight loop doesn't give great results, reading from /dev/random /dev/urandom will give better results. Perderabo posted a very good random number generator script also.
Reply With Quote
  #4 (permalink)  
Old 04-10-2008
Registered User
 

Join Date: Nov 2007
Posts: 8
Thanks for the tips.
The degree of randomness is not critical for me, so the print $RANDOM is fine.
I found Perderabo's script too, but it's probably more than I need at this stage.

Thanks again to all who replied.
B
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0