Re: bash script goes too fast
From: Andreas Tretow (andreas.tretow-ng_at_gmx.de)
Date: 02/14/04
- Next message: GVK: "Re: Xconfigurator"
- Previous message: Andreas Tretow: "Re: Redhat 7 and"
- In reply to: charly: "bash script goes too fast"
- Next in thread: charly: "Re: bash script goes too fast"
- Reply: charly: "Re: bash script goes too fast"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 14 Feb 2004 18:47:44 +0100
On Sat, 14 Feb 2004 17:44:45 +0000, charly wrote:
> Greetins,
>
> Im trying to achieve the following thing :
>
> tar cz /somedir -f somedir.tgz
> then put via ftp somedir.tgz to a remote server.
>
> I can do all this with no pb on command line.
>
> When i make it via script, it tries to ftp the file while it is still
> under construction -> file not found.
Don't be shy ;-), show us your script.
> I could do it like this :
> tar cz /somedir -f somedir.tgz &
> ftp
No you couldn't. A single ampersand, the control operator '&', means that
the command preceding it will be executed in a subshell in the background.
It will then go on and execute the next command regardless of the first
command's status. You want to use the control operator '&&', i.e. AND,
which will execute the second command only after the first command is
executed with an exit status of zero.
For more information have a look at 'man bash'.
> but I tar several files in several archives and need to transfer all of
> them then "rm" them.
Also have a look at 'man ncftpput' if you really have to use FTP,
otherwise try 'man ssh' and 'man scp'.
> Can someone tell me how can I make bash wait for tar processes to be
> done ?
>
> thank you !
HTH
Andreas
- Next message: GVK: "Re: Xconfigurator"
- Previous message: Andreas Tretow: "Re: Redhat 7 and"
- In reply to: charly: "bash script goes too fast"
- Next in thread: charly: "Re: bash script goes too fast"
- Reply: charly: "Re: bash script goes too fast"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|