The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
script don't stop larne Shell Programming and Scripting 3 10-12-2008 10:07 AM
I am geting error while trying to stop managed server of WEB LOGIC ASHISH MISHRA SUN Solaris 0 02-22-2007 08:22 AM
how to stop others users to stop viewing what i am doing ? mobile01 UNIX for Advanced & Expert Users 5 12-04-2006 08:37 AM
How do I stop this??? Cameron Filesystems, Disks and Memory 8 07-11-2002 01:10 AM
Stop a SAS job cube UNIX for Dummies Questions & Answers 1 05-02-2002 12:13 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
To Stop at error

Hi All,

I am running parallel process as they all run the same JOBS and only thing which changes is the argument which ia passed.
I am doing it as follows

script.sh $1 &
script.sh $2 &
script.sh $3 &..

and so on.

Now each process has same set of JOBS which are to be executed. Now say if any of the job fails it should ideally stop at that point. However its not happening at present.
Say script.sh $2 & process failed for some reason then it should stop at there itself while script.sh $1 & and script.sh $3 &.. should continue.

At present when script.sh $2 & is failing its not stopping and its going to the next JOB of the list.

Kindly suggest what can be done to avoid this
  #2 (permalink)  
Old 11-24-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
$? - stored exit status of previous command.

So check if $? = 0 run next script else exit and display error or what ever.
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 06:31 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