To call many scripts from mother one simultaneously


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting To call many scripts from mother one simultaneously
# 1  
Old 06-08-2009
To call many scripts from mother one simultaneously

Hi,
I need to rin few other scripts from one main (mather) script. Working in ksh on LINUX. The only one condition - it should be run in parallel.
I mean I have to be able to call 20 scripts from this mother script in parallel (start them in the same time). Does somebody know how to do it?

Thanks,
Juliy

Last edited by juliyp; 06-08-2009 at 04:53 PM..
# 2  
Old 06-08-2009
call each script one by one and run them in background
scr1 &
scr2 &
scr3 &
.
.
.
scr20 &
# 3  
Old 06-08-2009
Simple loop to start them all

#!/bin/ksh
# the one-ring script
# to start them all

# a variable to hold all of the script names
SCRIPTLIST="script1
script2
script3
...
script20"

# start all child scripts in background
for foo in $SCRIPTLIST ; do
${foo} &
done

# only continue when they all finish
wait

# rest of master script
...
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Call functions from other scripts

i have a file that contains functions and i want the functions to be available in another script. of course, the ideal situation here would be to put the functions in the same script, but i dont own these scripts. so I have to call the functions file from a different script. how do i... (3 Replies)
Discussion started by: SkySmart
3 Replies

2. Shell Programming and Scripting

Run 2 shell scripts simultaneously from one script

i Run 2 scripts on all of around 50 nodes every day. 1.Mod_1.sh 2.Mod_2.sh eg.. i run file with specific node no like Mod_1.sh NODE_(node number) Mod_2.sh NODE_(node number) I want to run both file by using single script with unique node number. Eg.. Mod_new.sh NODE_(node... (11 Replies)
Discussion started by: Ganesh Mankar
11 Replies

3. Shell Programming and Scripting

How to call different scripts?

I have 3 different scripts with 3 different functions, I would like to merge these 3 and make a master script. The following are my ideas: - ask user to pick which script he needs - after choosing, point it to the right script or... depending on the inputs provided by the user, all three... (1 Reply)
Discussion started by: priyanka.premra
1 Replies

4. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

5. Shell Programming and Scripting

Behavior of Unix in calling 2 scripts simultaneously

Hi, I wanted to know the exact behavior of the shell scripts in the below scenario. I have 2 scripts - a.ksh and b.ksh Both these scripts call a 3rd script xyz.ksh. What will happen if both a.ksh and b.ksh run at the same time? What will happen if a.ksh starts 2-3 seconds before b.ksh?... (3 Replies)
Discussion started by: aster007
3 Replies

6. Shell Programming and Scripting

Call Multiple Scripts With Similar Name

I have a lot of scripts in one directory I was just wondering if there was a single command that could call each script. Example: There are scripts, "stopThisService.sh", "stopThatService.sh", "stopAnotherService.sh", and "stopYetAnotherService.sh". I'd like to be able to call them all by... (1 Reply)
Discussion started by: mrwatkin
1 Replies

7. Linux

Call scripts in Rpm's: %pre %post sectino

Hi, In the rpm SPEC file there is %pre section for preinstall scripts. We can write any think in the "sh" format here. I want to call a script here. How can i do this? Thanks (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

8. UNIX for Dummies Questions & Answers

how to call two programs simultaneously

Hi, i want to call two programs simultaneously from a currently running program so as to distribute the job and fasten the speed. As of now I call the programs one after the other within the main program. e.g. `perl A.pl`; `perl B.pl`; how can I run the two paralelly? urgent ... please... (1 Reply)
Discussion started by: vipinccmb
1 Replies

9. Shell Programming and Scripting

How to call C functions in shell scripts?

How can i call dynamic C functions in shell scripts? (5 Replies)
Discussion started by: agarwal
5 Replies
Login or Register to Ask a Question