Hi all.
I’m having a “simple” problem here: I’m not able to find the random number generator commands (random, rand, and alikes) in my Suse 11.0 here. Other commands, like factor, seq, are easilly found, but this one isn’t. When I try to find it, it points me tu a executable in the /usr/games directory, which clearly isn’t the one I’m looking for. 
Could someone help me here with this? I’m thinking about creating a base for a genetic algorithm script here, and of course that can’t be done without randoms… 
Thanks in advance for any help! 
johannesrs wrote:
> Hi all.
>
> I’m having a “simple” problem here: I’m not able to find the random
> number generator commands (random, rand, and alikes) in my Suse 11.0
> here. Other commands, like factor, seq, are easilly found, but this one
> isn’t. When I try to find it, it points me tu a executable in the
> /usr/games directory, which clearly isn’t the one I’m looking for. 
>
> Could someone help me here with this? I’m thinking about creating a
> base for a genetic algorithm script here, and of course that can’t be
> done without randoms… 
>
> Thanks in advance for any help! 
There is no such command as ‘random’
There are ways to get PRN (Pseudo Random Numbers) in e.g. Bash, Python and other
scripting languages.
E.g.
<Bash>
$echo $RANDOM
23595
$python
Python 2.6 (r26:66714, Feb 3 2009, 20:52:03)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> from random import randint
>>> randint(0,65535)
9185
Using /dev/(u)random
$dd if=/dev/random bs=10 count=1 |xxd -a
1+0 records in
1+0 records out
0000000: f96d 9f71 563c 90ec 05c3 .m.qV<…
Theo
Ok, that’s the trick, it’s a variable for bash! 
I usually use tcsh. Just in case, is there any equivalent for tcsh? I’m not finding it with google, only whole scripts… 
Thanks a lot!
johannesrs wrote:
> Ok, that’s the trick, it’s a variable for bash! 
>
> I usually use tcsh. Just in case, is there any equivalent for tcsh? I’m
> not finding it with google, only whole scripts… 
>
> Thanks a lot!
Not as far as I can see.
Theo
No problems so. Or I switch shells, or make a small “random” function to be called.
Thanks a lot anyway! That really saved me! 