Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ns_rand(3aolserv) [debian man page]

ns_rand(3aolserver)					    AOLserver Built-In Commands 				       ns_rand(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
ns_rand - commands SYNOPSIS
ns_rand ?max? _________________________________________________________________ DESCRIPTION
ns_rand generates a cryptographically-secure random number. If max is not specified, the random number is a floating-point value n such that 0.0 <= n < 1.0. If max is specified, it must be a positive integer between 0 and 2147483647. The return value is an integer value such that 0 <= n <= (max - 1). Internally ns_rand is implemented with the drand48(3) and lrand48(3) standard library functions. An internal random seed is generated the first time ns_rand is called after the server starts. EXAMPLES
nscp> ns_rand 0.39938485692 nscp> ns_rand 10 7 SEE ALSO
nsd(1), info(n), drand48(3), lrand48(3) KEYWORDS
AOLserver 4.0 ns_rand(3aolserver)

Check Out this Related Man Page

ns_tmp(3aolserver)					    AOLserver Built-In Commands 					ns_tmp(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
ns_mktemp, ns_tmpnam - commands SYNOPSIS
ns_mktemp template ns_tmpnam _________________________________________________________________ DESCRIPTION
ns_mktemp returns a unique filename based on the template you specify. ns_tmpnam returns a filename that can safely be used for a tempo- rary file. The template for ns_mktemp should contain a string with six trailing Xs, which will be replaced with an alpha-numeric string of six charac- ters chosen to make the filename unique. If template does not end with six trailing Xs the empty string will be returned. ns_tmpnam calls the tmpnam() C library function, and the results will depend on your operating system. On Irix, for example, tmpnam() always generate a file name using the path-prefix defined as P_tmpdir in the header file which is "/var/tmp/". EXAMPLES
nscp> ns_tmpnam ;# On Linux /tmp/filevuLwaE nscp> ns_mktemp /tmp/foobar.XXXXXX /tmp/foobar.p6SlaC SEE ALSO
nsd(1), mktemp(3), tmpnam(3) KEYWORDS
AOLserver 4.0 ns_tmp(3aolserver)
Man Page

8 More Discussions You Might Find Interesting

1. Programming

How to generate a random number?

How to generate a random integer with specific range(for example, from 1 to 1000)? Also, how to convert a floating point number into a integer? (2 Replies)
Discussion started by: MacMonster
2 Replies

2. Programming

Maximum File Size

Hi, When i checked for the maximum file size on solaris 5.9 the max file size obtained was only 2147483647 and all the further writes to the file which had reached that max size is not added to that file. even i had registered the signal SIGXFSZ, but the signal was not delivered to the... (5 Replies)
Discussion started by: matrixmadhan
5 Replies

3. Shell Programming and Scripting

How to read max of 10 file at a time?

Hi All, Please advise . Welcome more suggestions. For examples, I have 1000 file with prefix x??? In fact, I want to convert them to x???.txt with max 10 files at a time. As such, I will need to call another script to read from those 10 *txt files and sleep 5000 to convert the next 10 again.... (10 Replies)
Discussion started by: cedrichiu
10 Replies

4. Shell Programming and Scripting

Calc max of a column

In C that was easy with a for and if. Iam trying to learn a litle more in bash. Example Ronaldo:5800 Figo:4000 Rafael:2321 Kaka:1230 I want the max of the $2 and the output will be: The max value is 5800 from Ronaldo. How can i do this in shell? Thanks for all, folks. (11 Replies)
Discussion started by: rafazz
11 Replies

5. Solaris

I want to test max process on my system

Hi,everybody Please someone suggest me for test max process on system my system is Solaris 10/9 installed on HP DL380G6 . My point of project is test max process ,max user untill systemdown .however i have batch script telnet from pc to host about 500 window per pc ( i have pc 9 unit ... (2 Replies)
Discussion started by: infjustice
2 Replies

6. Homework & Coursework Questions

Process, where each process generates a random integer

Hello all, I am writing a program where user enters an integer and the program creates that number of processes. Each child process generates a random integer. When a child process calls a procedure say Myprocedure it should terminate where as the parent process wait for the child to terminate. (4 Replies)
Discussion started by: manisum
4 Replies

7. Shell Programming and Scripting

print max number of 2 columns - awk

Is it possible to print max number of 2 columns - awk note: print max if the integer is positive and print min if the integer is negative input a 1 2 b 3 4 c 5 1 d -3 -5 d -5 -3 output a 2 b 4 c 5 d -5 d -5 (4 Replies)
Discussion started by: quincyjones
4 Replies

8. Programming

Limits on 32 and 64 bit in C++ / C

Hi All, I am getting below run time error I checked the code and see the structure defined as below and using the file position variable typedef struct Get_file { char *current_pathname; unsigned int tot_bytes_io, physical_position; int... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies