On 21/09/2010 04:53:58, Ryan Coleman wrote: > As I said in my OP: I could just run a "cd" to the directory parent > and do it there - that would solve the problem - but that's simply > too dangerous if the script generator throws an error on the next set > of commands (a risk I do not want to take).
Um.... changing directory *is* the way to solve this. Really.
What you can do in a shell script is work in a sub-shell: that way,
even if your zip command goes bananas, you are automatically returned to
your original working directory. To create a sub-shell, just enclose
your commands in (brackets).
(
cd /mount/archive/orders/Sep20/1284343047-Le-ach/ ;
zip -r
/usr/www/d3photography.com/htdocs/images/paidphotos/1284343047-Le-ach.zip \
download*
)
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: [email protected] Kent, CT11 9PW
signature.asc
Description: OpenPGP digital signature
