Is there a random number generator for Puppy? (Solved)

Requests go here. If you fill a request, give it a new thread in the appropriate category and then link to it in the request thread.
Post Reply
Message
Author
User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#16 Post by Pizzasgood »

You can also do this from the shell, to get a number from 0 - 32767:

Code: Select all

echo $RANDOM
http://tldp.org/LDP/abs/html/randomvar.html
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
GustavoYz
Posts: 883
Joined: Wed 07 Jul 2010, 05:11
Location: .ar

#17 Post by GustavoYz »

Pizzasgood wrote:You can also do this from the shell, to get a number from 0 - 32767:

Code: Select all

echo $RANDOM
http://tldp.org/LDP/abs/html/randomvar.html
And, from 0 to any other number (5 in this case), like this:

Code: Select all

echo $[$RANDOM%6]
For floats, u can use somethig like this:

Code: Select all

perl -le 'print rand(6);'

Post Reply