[CentOS] shell script question

Thu Mar 13 17:09:23 UTC 2008
Garrick Staples <garrick at usc.edu>

On Thu, Mar 13, 2008 at 10:29:58PM +0700, Fajar Priyanto alleged:
> On Thursday 13 March 2008 22:04:23 Jerry Geis wrote:
> > If I have a shell script on 5.1 that has 2 commands in the script...
> >
> > command1
> > command2
> >
> > and command1 runs until it is kill'ed by some other process. Sometimes
> > command2 runs and sometimes it
> > doesnt (this is what it seems like).
> >
> > How can I be ensured that command2 will always run after command1 is
> > killed? The script is not killed
> > just command1.
> 
> Does command1 always need to be killed?
> How about: command1 && command2 ?

This would ensure that command2 is never run after command1 is killed (assuming
command1 is not trapping the signal and exiting successfully).

-- 
Garrick Staples, GNU/Linux HPCC SysAdmin
University of Southern California

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20080313/00fd17fd/attachment-0004.sig>