> 
>      I am trying to tell if a program is passing back an error in a Bas=
> h
>      script.  I would like to branch on receipt of the error to a wait
>      statement that will give me about 20 seconds and then retry.
> 
>      My trouble is I cannot remember how to detect the error and how to=
> 
>      make the shell wait a definite amount of time.  Can anyone help me=

The shortest way would be:

------------------------------------------------------------------------
#! /bin/bash

while ! program; do sleep 20; done
------------------------------------------------------------------------

This assumes that the program correctly exits wit an error state.

HTH,
Eric

-- 
 E.L. Meijer ([EMAIL PROTECTED])          | tel. office +31 40 2472189
 Eindhoven Univ. of Technology             | tel. lab.   +31 40 2475032
 Lab. for Catalysis and Inorg. Chem. (TAK) | tel. fax    +31 40 2455054


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to