Regarding Random Number Genration


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Regarding Random Number Genration
# 1  
Old 11-03-2008
Regarding Random Number Genration

HI

please help me in solving this issue.

I have a shell script which consists of ten statemnts ( i mean 10 executable statments)...........and if i run that script the 10 statmenst will execute continously ............

But now my probelm is i have to write another script --> to execute theses statmensts whihc are ther in the first one randomly ........

means instead of executing the executables like 1,2,3 4,--10 .................it has to execute 2,8,9,1 .like this .randomly

i hope i am clear with the question?

Please help me in this
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Generating a POSIX random number?

Hi Guys and gals... As you know I am getting to grips with POSIX and hit this stumbling block. Generating two random numbers 0 to 255 POSIXly. Speed in not important hence the 'sleep 1' command. I have done a demo that works, but it sure is ugly! Is there a better way? #!/bin/sh # Random... (12 Replies)
Discussion started by: wisecracker
12 Replies

2. Programming

random number

How can I choose randomly the row numbers of my file in awk? (4 Replies)
Discussion started by: Homa
4 Replies

3. Shell Programming and Scripting

Create random number

Hi, I'm trying to create a script that will print random numbers with length of three. Below is the expected out. 928-377-899 942-458-310 951-948-511 962-681-415 995-161-708 997-997-209 thanks (4 Replies)
Discussion started by: reignangel2003
4 Replies

4. Shell Programming and Scripting

Random pieces of number

Hello folks, i have number for example 10 and i want to divide into 4 random pieces that may be (6+2+1+1). How can i do this via script i have random number 234951 and i want to divide into 31 pieces. (6 Replies)
Discussion started by: learnbash
6 Replies

5. Programming

Generate random number

I saw this formula to generate random number between two specified values in shell script.the following. $(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+min)) Give a example in book. Generate random number between 6 and 30.like this. $(((RANDOM%30/3+1)*3)) But I have a... (1 Reply)
Discussion started by: luoluo
1 Replies

6. Programming

Random number is not reused

I need to generate and reuse a 5 digit random number every time my program is executed. But the following generates random numbers every time the function is called. #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <string.h> #include <time.h> ... (12 Replies)
Discussion started by: limmer
12 Replies

7. Programming

C Help; generating a random number.

Im new to C, and Im having a hard time getting a random number. In bash, I would do something similar to the following to get a random number; #!/bin/bash seed1=$RANDOM seed2=$RANDOM seed3=$RANDOM SEED=`expr $seed1 * $seed2 / $seed3` echo ${SEED%.*} Now, in online examples... (4 Replies)
Discussion started by: trey85stang
4 Replies

8. Shell Programming and Scripting

ksh: random number between 1-10

How do I create a random number between 1 and 10 in kornshell? (2 Replies)
Discussion started by: dangral
2 Replies

9. Programming

Random number generation

Hi...How can I generate random numbers between a given range ...preferably between 1 and 100...in UNIX C programming...? I tried out functions like rand(),drand48() etc but didnt get satisfactory results... Thanks a lot in advance.......... (1 Reply)
Discussion started by: tej.buch
1 Replies

10. 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
Login or Register to Ask a Question
cmrunserv(1m)															     cmrunserv(1m)

NAME
cmrunserv - run a service from the high availability package run script SYNOPSIS
cmrunserv [-v] service_name service_command_string cmrunserv [-v] [-r restarts] service_name service_command_string cmrunserv [-v] [-R] service_name service_command_string DESCRIPTION
cmrunserv is used in the high availability package run script to run a service. To start package's service, a user must either be superuser(UID=0), or have an access policy of FULL_ADMIN allowed in the cluster configu- ration file. See access policy in cmquerycl(1m) or cmmakepkg(1m). If the service process dies, cmrunserv updates the status of the service to down. The cluster software will recognize the change in status and execute the normal package recovery sequence. This includes executing the package halt script, determining if the package can be run on a different node, and, if so, executing the package run script on the new node. Should the service_command be halted by the cmhaltserv command, a SIGTERM signal will be sent to the process. This executable or shell script should be able to handle a SIGTERM signal and execute a graceful shutdown performing any cleanup necessary. If the process ignores the SIGTERM, a SIGKILL will be sent to the process. If a SIGKILL is sent, the process will die immediately and will be unable to perform any cleanup. Options cmrunserv supports the following options. -v Verbose output will be displayed. -r restarts Indicates that the service should be automatically restarted by the cluster software if it fails, without halting the package. restarts indicates how many times the service may fail before the package should be halted. -R Indicates the service should be restarted an unlimited number of times if it fails. service_name Name of the service as it exists in the package configuration information. service_command_string Process string to be started. This includes the process name and any arguments necessary for the process to run. The process name must be a full path, may be either a command name or a shell script, and must be executable. RETURN VALUE
cmrunserv returns the following values: 0 Successful completion. 1 Command failed. EXAMPLES
To run the service command string /var/opt/db/database1 under the service name db1, do the following: # Run the process /var/opt/db/database1 cmrunserv db1 /var/opt/db/database1 This line should only be executed within a package run script. AUTHOR
cmrunserv was developed by HP. SEE ALSO
cmhaltserv(1m), cmquerycl(1m), cmmakepkg(1m), cmmodnet(1m). Requires Optional Serviceguard Software cmrunserv(1m)