Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-15-2008, 07:38 AM   #1
Registered: Aug 2008
Posts: 54

Rep: Reputation: 15
Making Random Variables

Im rerunning a shell script under different options (which at first I thought I could solely use as a unique identifier, but realised my process is stochastic by nature so even identical start variables will give slightly different results) and wanted to know what you prefer? I was trying to find a random number/ASCII generator or putting a time stamp on it. Which is better and what command would I use to get it?
Old 09-15-2008, 07:41 AM   #2
Registered: Aug 2008
Posts: 54

Original Poster
Rep: Reputation: 15
I forgot to mention, I am using bash. Not sure if the command would be a coreutil or bash specific so I thought I should put that out there.
Old 09-15-2008, 08:09 AM   #3
Senior Member
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
Using bash, you can use the $RANDOM variable.
RANDOM Each time this parameter is referenced, a random integer between
0 and 32767 is generated. The sequence of random numbers may be
initialized by assigning a value to RANDOM. If RANDOM is unset,
it loses its special properties, even if it is subsequently


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: random creation of multiple variables vicious1 Programming 3 04-23-2007 04:34 AM
using /dev/random to output random numbers on a text file guguma Programming 4 04-02-2007 02:42 PM
KDE Random wallpaper or script to create symbolic links to random files cvelasquez Linux - Software 2 02-26-2007 07:48 PM
PHP making two variables from one Hondro Programming 1 12-12-2006 07:49 AM
Making a dev/random ??? ifm Linux - Newbie 3 06-12-2002 02:57 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:19 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration