The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to set constrain on random numbers in c ahjiefreak High Level Programming 6 01-11-2008 04:46 AM
how can i isolate the random sequence of numbers using awk? rcon1 UNIX for Dummies Questions & Answers 2 01-09-2008 09:06 AM
generating random numbers with hamming distance 4 hack_tom Shell Programming and Scripting 2 04-29-2007 02:27 AM
Random numbers without repetition asal_email UNIX for Dummies Questions & Answers 8 07-14-2005 05:02 AM
Sed - Replacing numbers w/asteriks in random location in a file giannicello UNIX for Dummies Questions & Answers 9 10-04-2001 01:03 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-26-2007
hack_tom hack_tom is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 11
genrating pseudo random numbers

I want to generate the file in following format

--------------------------------------
mov t1, %r1
mov t2, %g1
mov t3, %o1
.
.
.
.
m times

add %r1, %g1, %o1
add %r2, %g2, %o2
.
.
.
n times

-------------------------------------------
here t1, t2, t3. .. .. etc. random numbers generated between 0 and 32 bit largest number. and %r1 in mov can be %r1-%r32, %g1-%g7, %o0-%o7, %i0-%i7, %l0-%l7 which can also be generated randomely but all should be different in every line . Same case is for all lines begining with add.

will it be possible with perl script??
  #2 (permalink)  
Old 04-26-2007
hack_tom hack_tom is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 11
Also since %r1-%r32 .. etc are limited and are different for all lines the value of m and n will be less than 30.
  #3 (permalink)  
Old 04-26-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,954
Quote:
%r1-%r32

is %r1 a seperate value
and %r32 a different value
basically both of them being random numbers

and should the random numbers generated as this to be subtracted and displayed ?
  #4 (permalink)  
Old 04-26-2007
hack_tom hack_tom is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 11
hi it is not %r1-%r32, I mean to say %r1, %r2, %r3 ..... %r32. So I just wanted to generate for ex. mov t %r2 where t will be 32 bit random no. and %r2 is string which I also want to generate it randomely.
Sorry for confusion
  #5 (permalink)  
Old 04-27-2007
hack_tom hack_tom is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 11
ok if this is not possible atleast you can help me with perl script to generate following file

--------------------------------
mov t1
mov t2
mov t3
...
..
..
.
mov tn

where t1, t2, t3, .... tn are pseudo random numbers whose value ranges from 0 to largest 32 bit number.
  #6 (permalink)  
Old 04-27-2007
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,122
What does "largest 32 bit number" mean? 4294967296? 2147483648?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0