Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Sep 2010 06:14:07 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Ryan Coleman <editor@d3photography.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Zip file making issues
Message-ID:  <4C983F1F.700@infracaninophile.co.uk>
In-Reply-To: <70BA7AC2-7300-41F6-9D3E-7AFEAD7F533E@d3photography.com>
References:  <A166139D-842F-4ACA-B8B3-687A8C6ECE01@d3photography.com>	<F7E03E13906D419C8417713D17CF49C9@hermes> <70BA7AC2-7300-41F6-9D3E-7AFEAD7F533E@d3photography.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigFF807B0491A269683C45C2D1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW


--------------enigFF807B0491A269683C45C2D1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyYPyYACgkQ8Mjk52CukIz0IACePQgpkAU2+CkxRm1SkJlOLJdW
l6wAn3eBEbDNGpikgVF7xrHgFQ5ayIUf
=1FNw
-----END PGP SIGNATURE-----

--------------enigFF807B0491A269683C45C2D1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C983F1F.700>