05-14-2014
I don't follow what you're after....
Do you just want to create a random 6 digit number (1 - 999999)?
Not sure what this summation formula supposed to do either...
Please elaborate with example(s) if possible
10 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
Hi all
I've got MacOSX server which is a UNIX based system. I've got 2 partiontion an I like to make just one partition on he disk without loosing any data on part1. Is there a way to do that kind of thing in UNIX or do I have to format everything and put up the system again?
Thanx for reading... (3 Replies)
Discussion started by: gardarm
3 Replies
2. UNIX for Dummies Questions & Answers
Hello All,
I just wanted to know what are the different ways of using commands in combination.
The most common one which i know is using pipes.
Also grouping is also done like ( ls; date) where output of both the commands is displayed.
Are there any other ways of combining various... (2 Replies)
Discussion started by: rahulrathod
2 Replies
3. UNIX for Dummies Questions & Answers
I want to show a output like this
Lee Ballancore
PID TTY TIME CMD
31799 pts/3 00:00:00 vim
31866 pts/3 00:00:00 vim
2495 pts/7 00:00:00 vim
8368 pts/0 00:00:00 vim
9544 pts/2 00:00:00 ps
Alistairr Rutherford
PID TTY TIME CMD
8368 pts/0 00:00:00 vim
9544 pts/2 00:00:00 ps
... (3 Replies)
Discussion started by: nehaquick
3 Replies
4. Shell Programming and Scripting
Hi Folks
Probably an easy one here but how do I get a sequence to get used as mentioned. For example in the following I want to automatically create files that have a 2 digit number at the end of their names:
m@pyhead:~$ for x in $(seq 00 10); do touch file_$x; done
m@pyhead:~$ ls file*... (2 Replies)
Discussion started by: amadain
2 Replies
5. Shell Programming and Scripting
Hi
I have 2 files like:
file1
a 12
b 1
a 3
file2
a 9
c 0
a 8
and i would like to get
a 12 a 9
a 3 a 8
i can do it with grep and paste with 3 lines. I tried to combine using: (3 Replies)
Discussion started by: Dedalus
3 Replies
6. Shell Programming and Scripting
Hello Group,
I have a file of data that contain
1
2
3
4
5
I request you help with a shell script for generate all posible combination of these numbers with the following output:
Example:
1 + 2 + 3 + 4 + 5 =
2 + 2 + 3 + 4 + 5 =
3 + 2 + 3 + 4 + 5 =
Thanks in advance.
Carlos (7 Replies)
Discussion started by: csierra
7 Replies
7. Shell Programming and Scripting
Hello all! I've looked all over the internet and this site and have come up a loss with an easy way to make a bash script to do what I want to do. I have a file with a naming convention as follows:
2012-01-18 string of words here 123.jpg
2012-01-18 string of words here 1234.jpg
2012-01-18... (2 Replies)
Discussion started by: Buzzman25
2 Replies
8. Shell Programming and Scripting
Hi folks,
I have a numbers from 1-100 and from these nos I have 30 numbers.. From this 30 nos, I have to generate a combination of 6 nos... this 30 numbers will range from 1-100... ( FYI: This is not a lottery game - just kidding) ... I am trying out this in a shell script.. any ideas ? (3 Replies)
Discussion started by: gsiva
3 Replies
9. UNIX for Beginners Questions & Answers
Good morning, In a Production environment ive seen this command that kills processes
kill -9 -1
Because i am in a production environmet i can not execute this comamnd, so i would like to know what is the difference for the conventional kill -9 PID ?
Thanks a lot (11 Replies)
Discussion started by: alexcol
11 Replies
10. UNIX for Beginners Questions & Answers
Hi All ,
I am having an input file as stated below
5728 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r03_q_reg_20_/Q 011
611 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r04_q_reg_20_/Q 011
3486... (4 Replies)
Discussion started by: kshitij
4 Replies
rand(3C) Standard C Library Functions rand(3C)
NAME
rand, srand, rand_r - simple random-number generator
SYNOPSIS
#include <stdlib.h>
int rand(void);
void srand(unsigned int seed);
int rand_r(unsigned int *seed);
DESCRIPTION
The rand() function uses a multiplicative congruential random-number generator with period 2**32 that returns successive pseudo-random num-
bers in the range of 0 to RAND_MAX (defined in <stdlib.h>).
The srand() function uses the argument seed as a seed for a new sequence of pseudo-random numbers to be returned by subsequent calls to
rand(). If srand() is then called with the same seed value, the sequence of pseudo-random numbers will be repeated. If rand() is called
before any calls to srand() have been made, the same sequence will be generated as when srand() is first called with a seed value of 1.
The rand_r() function has the same functionality as rand() except that a pointer to a seed seed must be supplied by the caller. If
rand_r() is called with the same initial value for the object pointed to by seed and that object is not modified between successive calls
to rand_r(), the same sequence as that produced by calls to rand() will be generated.
The rand() and srand() functions provide per-process pseudo-random streams shared by all threads. The same effect can be achieved if all
threads call rand_r() with a pointer to the same seed object. The rand_r() function allows a thread to generate a private pseudo-random
stream by having the seed object be private to the thread.
USAGE
The spectral properties of rand() are limited. The drand48(3C) function provides a better, more elaborate random-number generator.
When compiling multithreaded applications, the _REENTRANT flag must be defined on the compile line. This flag should be used only in mul-
tithreaded applications.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO
drand48(3C), attributes(5), standards(5)
SunOS 5.10 19 May 2004 rand(3C)