From owner-freebsd-questions@FreeBSD.ORG Tue Sep 21 05:14:28 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DA28106564A for ; Tue, 21 Sep 2010 05:14:28 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3fd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id 6A2B18FC17 for ; Tue, 21 Sep 2010 05:14:27 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.4/8.14.4) with ESMTP id o8L5EE8u007916 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 21 Sep 2010 06:14:21 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) Message-ID: <4C983F1F.700@infracaninophile.co.uk> Date: Tue, 21 Sep 2010 06:14:07 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Ryan Coleman References: <70BA7AC2-7300-41F6-9D3E-7AFEAD7F533E@d3photography.com> In-Reply-To: <70BA7AC2-7300-41F6-9D3E-7AFEAD7F533E@d3photography.com> X-Enigmail-Version: 1.1.1 OpenPGP: id=60AE908C Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigFF807B0491A269683C45C2D1" X-Virus-Scanned: clamav-milter 0.96.2 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=4.1 required=5.0 tests=BAYES_50,DKIM_ADSP_ALL, SPF_FAIL,URI_OBFU_WWW autolearn=no version=3.3.1 X-Spam-Level: **** X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lucid-nonsense.infracaninophile.co.uk Cc: FreeBSD Questions Subject: Re: Zip file making issues X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 05:14:28 -0000 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--