Running parallel process


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Running parallel process
# 8  
Old 05-23-2012
Code:
script1 > filea &
script2 > filea &
script3 > filea &
script4 > filed &
wait
cat filea fileb filec filed > bigfile

# 9  
Old 05-23-2012
Quote:
Originally Posted by sagar_1986
RUN ALL THE FOUR PROCESS AFTER COMPLETING THAT COMBINE THE OUTPUT OF ALL THE FOUR SCRIPT INTO ONE FILE.
No need to shout.

I figured log_1, log_2, log_3, etc were scripts since you were obviously running them. Hence, mystified what you were trying to do.
# 10  
Old 05-23-2012
could be like this:-

cat main.sh

Code:
{
sh test.sh > 1.log
sh test2.sh > 2.log
sh test3.sh > 3.log
sh test4.sh > 4.log

cat *.log > combine.log
}

then run sh main.sh... you could see all output combine in 1 file...

OR

Code:
cat main.sh

Code:
{
sh test.sh > 1.log
sh test2.sh >> 1.log
sh test3.sh >> 1.log
sh test4.sh >> 1.log
}


then run sh main.sh... you could see all output combine in 1 file...

Last edited by Scrutinizer; 05-23-2012 at 02:59 PM..
# 11  
Old 05-27-2012
but dear friends its not working

after the all scripts completed its not coming out of that script

means


Code:
test1.sh &
test2.sh &
test3.sh &


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


its running all the script but its not executing the appending operation of log.

take one example.

Code:
#test3.sh

while [ $i le 20 ]
do
echo "$1"
i=`expr $i + 1`
done

output

Code:
1
2
3
4
5

the script is getting held at 5 its not operation after this stage as we have to append the logs of four scripts into one
# 12  
Old 05-27-2012
If you have GNU Parallel GNU Parallel - GNU Project - Free Software Foundation installed you can do this:
Code:
parallel '{} >{.}.out' ::: sample*.sh

or:
Code:
seq 4 | parallel "sample{}.sh > {}.out"

You can install GNU Parallel simply by:
Code:
wget http://git.savannah.gnu.org/cgit/par...n/src/parallel
    chmod 755 parallel
    cp parallel sem

Watch the intro videos for GNU Parallel to learn more:
https://www.youtube.com/playlist?lis...4C9FF2488BC6D1
This User Gave Thanks to tange For This Post:
 
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