LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

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

Rep: Reputation: Disabled
nohup inside loop


HI,

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

do

processing_script $i

done

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, 04:42 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,533
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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.
 
  


Reply


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 03:26 AM
bash: variables inside while loop J_Szucs Programming 5 07-19-2009 08:24 AM
trouble with expr inside a while loop farkus888 Linux - General 5 04-06-2007 03:19 AM
problem with nohup command and nohup file size vbseeker Linux - General 1 09-17-2006 11:36 AM
for loop inside select box opioid Programming 1 03-17-2005 02:22 PM


All times are GMT -5. The time now is 01:35 PM.

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