Zip file making issues

Matthew Seaman m.seaman at
Tue Sep 21 05:14:28 UTC 2010

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/ \



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     Ramsgate
JID: matthew at               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url :

More information about the freebsd-questions mailing list