LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-01-2007, 10:54 PM   #1
lothario
Member
 
Registered: Apr 2004
Posts: 340

Rep: Reputation: 30
Generate a random number from a bourne shell script


How do I generate a random number between 500 and 5,000 from a bourne shell script?
 
Old 03-01-2007, 11:00 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
http://tldp.org/LDP/abs/html/randomv...#RANDOMBETWEENYou may need to adjust as this is a Bash script.
 
Old 03-01-2007, 11:01 PM   #3
baldwonder
Member
 
Registered: Sep 2004
Location: Florida
Distribution: Slackware, VectorLinux, FreeBSD,Xubuntu
Posts: 69

Rep: Reputation: 15
Here is a site that talks about bourne scripting. At the bottom, there is an example that generates a random number between 0 and 99.

http://xray.bmc.uu.se/~remco/program...ng_course.html
 
  


Reply



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
pls help on how i can generate 4 digit random number that are unique within the set icylicious Programming 7 08-22-2006 01:00 PM
for statement in bourne shell script bujecas Linux - General 3 07-17-2006 07:32 AM
Generate random number with C++ TruongAn Programming 5 11-09-2005 12:01 AM
Help with basic bourne shell script rnj Programming 6 09-13-2005 08:41 PM
Python problems trying to generate a random number davholla Programming 0 10-27-2003 04:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:10 PM.

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