Running parallel process


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Running parallel process
# 1  
Old 05-03-2012
Tools Running parallel process

i am having 4 process,have to run parallel and not after one by one.
sample1.sh
sample2.sh
sample3.sh
sample4.sh

Thanks in advance.

i
# 2  
Old 05-03-2012
Try
Code:
sample1.sh &
sample2.sh &
sample3.sh &
sample4.sh &
wait


I hope that this helps
Robin
Liverpool/Blackburn
UK
# 3  
Old 05-03-2012
do i have to write this in file or it can be run directly.
As i have to put output of each script in to single file
and what is the exact role of "wait" command as mentioned above
# 4  
Old 05-03-2012
This could be either keyed on the command line or filed and run as a script. The wait will hold up further processing until all background tasks have completed.

Would you be wanting all the output into a single file from this run? If so, then save these in a file with a few adjustments:-

Code:
> output.file                  # Clear the output file first
sample1.sh >> output.file &    # Run sample1 and append output
sample2.sh >> output.file &    # Run sample1 and append output
sample3.sh >> output.file &    # Run sample1 and append output
sample4.sh >> output.file &    # Run sample1 and append output
wait


Be careful that you don't have any other background processes running for your session as you will wait for those too. of course, there is no way to know what order thse scripts will write their output, so you might have to consider that.



Robin
Liverpool/Blackburn
UK
This User Gave Thanks to rbatte1 For This Post:
# 5  
Old 05-23-2012
Error parallel process problem

i have tried this one

Code:
sample1.sh &
sample2.sh &
sample3.sh &

log_1 > new.txt
log_2 >> new.txt
log_3 >> new.txt 


but the second part is not working after the first process (3 scripts are finished)

plz suggest something

Last edited by sagar_1986; 05-23-2012 at 11:29 AM.. Reason: code tag
# 6  
Old 05-23-2012
I have no idea what you're even trying to do there. What would you expect that to be doing?
# 7  
Old 05-23-2012
RUN ALL THE FOUR PROCESS AFTER COMPLETING THAT COMBINE THE OUTPUT OF ALL THE FOUR SCRIPT INTO ONE FILE.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Monitoring processes in parallel and process log file after process exits

I am writing a script to kick off a process to gather logs on multiple nodes in parallel using "&". These processes create individual log files. Which I would like to filter and convert in CSV format after they are complete. I am facing following issues: 1. Monitor all Processes parallelly.... (5 Replies)
Discussion started by: shunya
5 Replies

2. Shell Programming and Scripting

Running script in Parallel

Hi Folks I have a doubt. I have a script which is running with 2 input parameters ./GetDSLnkCount.sh <jobnumber> Parmfile.txt I need to run the script in parallel for different jobnumbers. The commands are ./GetDSLnkCount.sh jnhuc14500 Parmfile.txt ./GetDSLnkCount.sh jnhuc14501... (3 Replies)
Discussion started by: morbid_angel
3 Replies

3. Shell Programming and Scripting

Multiple child running parallel

Hi , I am using sun Solaris machine. The machine description is given below SunOS ptxsa021 5.9 Generic_118558-24 sun4u sparc SUNW,Sun-Fire-15000 I am using korn shell.the scripts is below Parent code is given below..it is the part of code #!/bin/ksh # Script Name:... (3 Replies)
Discussion started by: ashutosh2378
3 Replies

4. Shell Programming and Scripting

Running uniq -c and sort -nr in parallel.

Hi All, I have a huge collection of files in a directory about 200000. I have the command below but it only uses one core of the computer. I want it to do task in parallel. This is the command that I want to run in parallel: sort testfile | uniq -c | sort -nr I know how to run sort... (10 Replies)
Discussion started by: shoaibjameel123
10 Replies

5. Shell Programming and Scripting

Running jobs in parallel

I need to process 50 sqlplus scripts which are listed in a text file. I need to develop a shell script that'll read this file and run these sqlplus scripts. At any point of time, the number of sqlplus scripts running shouldn't exceed 6. If any of the sqlplus scripts completes successfully then... (17 Replies)
Discussion started by: gctex
17 Replies

6. Shell Programming and Scripting

Running shell script in parallel

Hi, I am a shell script which takes input parameters and performs various functions. My concern is, if we call the same shell script with different parameter values from different sessions, will the results be inconsistent? Are there any precautions I need to take inorder to avoid conflicts... (1 Reply)
Discussion started by: jamjam10k
1 Replies

7. UNIX and Linux Applications

How can i see if a unix Process Aplication i.e oracle is running in parallel

There is a unix process process in oracle running and i see running by typing ps -fea|grep GE_CLIENTES. The question is How can i see if this process is running in paralel. I dont know with a Unix command or specifically its a comand from Oracle. I kow a Parallel process ia a process that... (1 Reply)
Discussion started by: alexcol
1 Replies

8. IP Networking

running servers parallel

I'm going to undertake a hardware refresh soon and I was wondering if it is possible to run two machines (X and Y) with the same hostname (but different IP addresses) on the same network? Server X is the original server and has an entry in DNS. Server Y is the new server and won't have an entry... (1 Reply)
Discussion started by: soliberus
1 Replies

9. Shell Programming and Scripting

Running scripts in parallel

Hi, Iam having the scripts as follows. i jus want to run those in parallel. main aim is to minimise the time for overall execution of the script. now out.txt is having 1 lac records. script1(split.sh) split -1000 out.txt splitout ls -A splitout* > filelist.txt cat filelist.txt... (6 Replies)
Discussion started by: nivas
6 Replies

10. Programming

running a parallel program

hi , i need to run a parallel program . for example; program1 { array=" the second program should called here : program 2" the execution should continue } the 2nd program should recieve an array of information as argument and it should... (4 Replies)
Discussion started by: bankpro
4 Replies
Login or Register to Ask a Question