Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-01-2012, 04:33 AM   #1
LQ Newbie
Registered: Sep 2011
Posts: 14

Rep: Reputation: Disabled
nohup inside loop


I Need to run the same script using multiple input values inside a loop.

#COde looks such as below

for i in 1 2 3 4 5 6 7 8 9 10


processing_script $i


The above code would loop the script 10 times in serial. PLease let me know how could i make

1. THe looping to happen in parallel so that processing_script runs in parallel for all the 20 set of values
2. Need to check the return code from each of the parallel runs.

THanks in advance.
Old 10-01-2012, 05:42 AM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
AFAIK GNU parallel is designed to do what you want.

There's a related StackOverflow thread which suggests what you want to do is not possible in bash alone.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
stream editing inside the while loop m4rtin Programming 7 03-11-2010 04:26 AM
bash: variables inside while loop J_Szucs Programming 5 07-19-2009 09:24 AM
trouble with expr inside a while loop farkus888 Linux - General 5 04-06-2007 04:19 AM
problem with nohup command and nohup file size vbseeker Linux - General 1 09-17-2006 12:36 PM
for loop inside select box opioid Programming 1 03-17-2005 03:22 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration