10-28-2008
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Does anyone know of some good books on shell scripting. Any and all help is greatly apprieciated. (3 Replies)
Discussion started by: Naaou
3 Replies
2. Shell Programming and Scripting
Can Anyone suggest few good books on Unix Shell Programming and C on Unix.
Thanks
Prasad (5 Replies)
Discussion started by: pswar70
5 Replies
3. Shell Programming and Scripting
All,
I am new to shell scripting. Can you guys suggest me some good books/online tutorials for shell scripting(KSH/BASH)? Thanks in advance.
Janardhan. (1 Reply)
Discussion started by: raok1997
1 Replies
4. Shell Programming and Scripting
Hi,
I am knew to Shell Scripting.
Can someone please tell me some good books for Shell Scripting which explains in a very simple language and covers all the topics nicely.
Thanks,
Shubh. (3 Replies)
Discussion started by: shubhranshu
3 Replies
5. Shell Programming and Scripting
Hi,
I had completed RHCE and i am interested to learn shell scripting.
Request you to please let me know which book is best for learning shell scripting or any online website.
Thanks & Regards
arun (2 Replies)
Discussion started by: Arun.Kakarla
2 Replies
6. Shell Programming and Scripting
Hi
i am new to UNIX completely. i dont know any thing about UNIX.
can some one please help me with some books on the unix archetecture and all the internal working of UNIX OS (i want to know every thing about unix from basics) and shell programming.
can any one please if available provide... (1 Reply)
Discussion started by: amiman
1 Replies
7. Shell Programming and Scripting
Now i'm reading <Advanced Bash scripting Guide> and that book lists too many examples and show little explanations.That makes me feel confused.Do any1 has some better book recommend to me about Bash? (4 Replies)
Discussion started by: homeboy
4 Replies
8. Shell Programming and Scripting
hello all,
Could you point me to the best book to start shell scripting.
thanks (3 Replies)
Discussion started by: acdc
3 Replies
9. Ubuntu
pleas suggest free e books to begin Bash scripting in ubuntu..... (2 Replies)
Discussion started by: vyom
2 Replies
10. Homework & Coursework Questions
I've purchased few unix/linux programming books and also planning to buy couple of books in future. I've got the following books;
Advanced Unix Programming(2nd ed) -- M. Rochkind.
Advanced Programming on Unix Environment(3rd ed) -- Late Rick Stevens & Rago.
Unix Systems Programming -... (8 Replies)
Discussion started by: vectrum
8 Replies
RAND(3) Linux Programmer's Manual RAND(3)
NAME
rand, srand - random number generator.
SYNOPSIS
#include <stdlib.h>
int rand(void);
void srand(unsigned int seed);
DESCRIPTION
The rand() function returns a pseudo-random integer between 0 and RAND_MAX.
The srand() function sets its argument as the seed for a new sequence of pseudo-random integers to be returned by rand(). These sequences
are repeatable by calling srand() with the same seed value.
If no seed value is provided, the rand() function is automatically seeded with a value of 1.
RETURN VALUE
The rand() function returns a value between 0 and RAND_MAX. The srand() returns no value.
NOTES
The versions of rand() and srand() in the Linux C Library use the same random number generator as random() and srandom(), so the lower-
order bits should be as random as the higher-order bits. However, on older rand() implementations, the lower-order bits are much less ran-
dom than the higher-order bits.
In Numerical Recipes in C: The Art of Scientific Computing (William H. Press, Brian P. Flannery, Saul A. Teukolsky, William T. Vetterling;
New York: Cambridge University Press, 1992 (2nd ed., p. 277)), the following comments are made:
"If you want to generate a random integer between 1 and 10, you should always do it by using high-order bits, as in
j=1+(int) (10.0*rand()/(RAND_MAX+1.0));
and never by anything resembling
j=1+(rand() % 10);
(which uses lower-order bits)."
Random-number generation is a complex topic. The Numerical Recipes in C book (see reference above) provides an excellent discussion of
practical random-number generation issues in Chapter 7 (Random Numbers).
For a more theoretical discussion which also covers many practical issues in depth, please see Chapter 3 (Random Numbers) in Donald E.
Knuth's The Art of Computer Programming, volume 2 (Seminumerical Algorithms), 2nd ed.; Reading, Massachusetts: Addison-Wesley Publishing
Company, 1981.
CONFORMING TO
SVID 3, BSD 4.3, ISO 9899
SEE ALSO
random(3), srandom(3), initstate(3), setstate(3)
GNU
1995-05-18 RAND(3)