The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Parallel SSH execution and a single shell to control them all iBot UNIX and Linux RSS News 0 10-30-2008 04:50 AM
parallel processing audippa Shell Programming and Scripting 3 03-01-2007 12:01 PM
Make : parallel execution suman_jakkula AIX 0 03-14-2006 03:33 AM
parallel environment in aix mzzt AIX 0 01-09-2006 03:32 PM
Parallel Execution RishiPahuja Shell Programming and Scripting 4 05-10-2005 03:15 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-24-2008
Prashantckc Prashantckc is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 18
Parallel Job Execution

Hi All,
At present I am using a UNIX Script which is running a set of JOBS. These JOBS are to be repeated for 20 times, means the same set of JOBS are repeated by just passing different arguments (From 1 to 20).

Is there any way by which I can execute them parallel?

At present its all sequential process of executing the same set of JOBS one at a time.
  #2 (permalink)  
Old 11-24-2008
dennis.jacob dennis.jacob is offline Forum Advisor  
dj - the student
  
 

Join Date: Feb 2007
Location: Singapore/Bangalore/Cochin
Posts: 610
Run it in the bg as below:

Code:
script.sh arg1 &
script.sh arg2 &
script.sh arg3 &
script.sh arg4 &
....

  #3 (permalink)  
Old 11-26-2008
Prashantckc Prashantckc is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 18
Many thanks for this help .
I have done these changes and it worked.

Only thing which I have noticed that after I call papallel execution as

script.sh arg1 &
script.sh arg2 &
script.sh arg3 &
script.sh arg4 &

The prompt is not coming in UNIX (KSH Prompt) and I have to explicitly hit an Enter key.

May be since I am executing the parallel processes and hence the issue. Is there any way by which I can return the prompt after all the parallel executions?
  #4 (permalink)  
Old 05-02-2009
devtakh devtakh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore
Posts: 514
Ideally, when we run a job in the background, the shell should immediately return a PID of the job and the command prompt should return to accept another command.

If the script immediately returns the output to the terminal, you might need to hit enter to come back to the prompt. To avoid this, you can redirect the o/p and std error to the appropriate files.

ex


Code:
script.sh arg4 > outfile 2>/dev/null &


cheers,
Devaraj Takhellambam
  #5 (permalink)  
Old 05-02-2009
preethgideon preethgideon is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 71
Or I guess you can try

nohup ................ &

This should help.


Thanks and Regards,
Gideon.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0