Executing multiple processes without waiting for their exit status.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Executing multiple processes without waiting for their exit status.
# 1  
Old 11-19-2010
Executing multiple processes without waiting for their exit status.

Hello Friends,

Hope you are doing well.

I just need a help in executing multiple processes.

I've written a shell script which calls another scritps. But the problem is there are too many processes to run, and each process takes about a min to finish its execution.

So, I want to just execute processes one after another without waiting for their termination.

Any help would be highly appereciated.

Thanks,
Chandan Singh
# 2  
Old 11-19-2010
Try using nohup and run the process in the background with &
# 3  
Old 11-19-2010
Thanks for your suggestion, Mate.

Nohup will create a nohup.out and will run the process in background.

Is there any other way to achieve this without using nohup?

Thanks,
Chandan
# 4  
Old 11-19-2010
Hi.

The GNU versions of xargs can manage processes:
Code:
       --max-procs=max-procs
       -P max-procs
              Run up to max-procs processes at a time; the default is  1.   If
              max-procs  is 0, xargs will run as many processes as possible at
              a time.  Use the -n option with -P; otherwise chances  are  that
              only one exec will be done.

-- excerpt from man xargs

See also GNU Parallel - GNU Project - Free Software Foundation

Best wishes ... cheers, drl
This User Gave Thanks to drl For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

C Exit Not Executing

Greetings all, I am using an enterprise utility for document archiving. This program calls a custom C exit to do data manipulation before loading data into the archive. When the program is called via an automation script (Ran as ROOT), program successfully executes the C exit, and gives me an... (3 Replies)
Discussion started by: jeffs42885
3 Replies

2. Shell Programming and Scripting

Want to get the exit status

Hi All, I am trying to create a zip file with all the txt files(these are in large number) in the current directory. I am able to do this operation sucessfully. After this i want to get the status of the tar command executed and do accordingly. When i am trying with the below code, the status... (3 Replies)
Discussion started by: paddu
3 Replies

3. Shell Programming and Scripting

Exit Status

I have a shell script (#!/bin/sh) that interacts with Appworx and Banner Admin. In my script I want to check the exit status of awrun before continuing. awrun can run for 10 seconds or it can run for over a minute. So my question is, will it go through my if statement before awrun may even be... (2 Replies)
Discussion started by: smkremer
2 Replies

4. Fedora

Another app is currently holding the yum lock; waiting for it to exit...

I'm trying to install wireshark on Fedora(latest version with gnome3) and I keep getting the above error. I keep killing the offending process after finding it's pid using "ps aux | grep yum", but the same process spawns again with a different pid. root 1605 0.0 3.4 54424 26228 ? SN 10:51 0:02... (1 Reply)
Discussion started by: shwick2
1 Replies

5. UNIX for Dummies Questions & Answers

Processes and exit status

Hi, I can't understand why the last $? is 1? can somebody plz help me to understand it? thanks $ ksh $ ps -f UID PID PPID C STIME TTY TIME COMMAND msarabad 12361 12319 0 15:17:58 pts/1 0:00 ksh msarabad 12319 12317 0 15:15:11 pts/1 0:00 -sh msarabad 12362 12361 ... (7 Replies)
Discussion started by: messi777
7 Replies

6. Shell Programming and Scripting

Exit status

I'm preparing for exam and one of exams is to write own test command... I wonder if in unix is a command which just returns exit code you specify.. I know I can easily write a function like this: exStatus() { return $1 } -> my question is rather theoretical thank you! (9 Replies)
Discussion started by: MartyIX
9 Replies

7. UNIX for Dummies Questions & Answers

monitoring 'waiting' processes

Is it possible to monitor processes whether they are waiting or active? Basically I would like to know since which TIME the process has been running and the state. :confused: (3 Replies)
Discussion started by: jon80
3 Replies

8. Programming

parent not waiting until child complete executing another program through execl()

Hi, I am calling a program that greps and returns 72536 bytes of data on STDOUT, say about 7000 lines of data on STDOUT. I use pipe from the program am calling the above program. Naturally, I execute the above program (through execl() ) throught the child process and try to read the... (4 Replies)
Discussion started by: vvaidyan
4 Replies

9. Shell Programming and Scripting

retrieving exit status from background processes

Hi, I need to retrieve the exit status of 4 moves running as background processes. The wait command will not work since it can only give me the exit status of the last of the background processes. Here's a sample of what I need !#/bin/ksh mv /dir1/subdir1/*.Z /dir6/subdir6/ & mv... (2 Replies)
Discussion started by: MG537
2 Replies

10. Shell Programming and Scripting

exit status

i downloaded a text file from metalab.unc.edu called sh.txt and in this reference manual it refers to shell scripting exit status .. at the end of one of the examples that author gave an exit status of 127.. to what does a 127 exit status refer too and what is its purpose in the code. moxxx68 (1 Reply)
Discussion started by: moxxx68
1 Replies
Login or Register to Ask a Question