Re: Using the wait function

From: Bill Marcum (bmarcum_at_iglou.com)
Date: 05/29/03


Date: Thu, 29 May 2003 10:40:10 -0400

On 29 May 2003 06:55:06 -0700, Anne
  <apembert@hq.nasa.gov> wrote:
> Hello,
>
> I'm using both tar and gzip in a script which also writes to a LOG
> when both
> functions have been done. But it seems that only the tar is getting
> done, and
> not the gzip.
> I'd like to use the "wait" command, but should it be used between the
> two functions, or after such as in the example:
>
> tar -cvf $FILE dumps
> echo "$FILE created" >> $LOG
> gzip $FILE
> wait
> echo "$FILE was gzipped" >> $LOG
>
The wait shouldn't be necessary, since there isn't an & in your script,
but you could do
tar -cf - | gzip >$FILE
or, if you have gnu tar
tar -cvzf $FILE

-- 
This place is called Antarctica. There is no kitten here.


Relevant Pages