From owner-freebsd-questions@FreeBSD.ORG Tue Sep 21 03:49:22 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 CA01D1065670 for ; Tue, 21 Sep 2010 03:49:22 +0000 (UTC) (envelope-from matt@gsicomp.on.ca) Received: from gsicomp.on.ca (gsicomp.on.ca [200.46.208.251]) by mx1.freebsd.org (Postfix) with ESMTP id 92B408FC13 for ; Tue, 21 Sep 2010 03:49:22 +0000 (UTC) Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by gsicomp.on.ca (Postfix) with ESMTP id 3EF5CFCB21A; Tue, 21 Sep 2010 03:32:25 +0000 (UTC) Received: from gsicomp.on.ca ([200.46.208.251]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 82411-01; Tue, 21 Sep 2010 03:32:25 +0000 (UTC) Received: from hermes (CPE002129cfd480-CM001ac3584898.cpe.net.cable.rogers.com [99.236.129.198]) by gsicomp.on.ca (Postfix) with SMTP id 7F305FCA435; Tue, 21 Sep 2010 03:32:24 +0000 (UTC) Message-ID: From: "Matt Emmerton" To: "Ryan Coleman" , "FreeBSD Questions" References: Date: Mon, 20 Sep 2010 23:32:25 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 Cc: 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 03:49:22 -0000 ----- Original Message ----- From: "Ryan Coleman" To: "FreeBSD Questions" Sent: Monday, September 20, 2010 11:11 PM Subject: Zip file making issues Does anyone have any advice for this? I'm working on a series of commands - executed in a shell script - that zips a deep directory in a tree. But it makes the full path as part of the ZIP file. That's not what I want - I just want those directories that appear after the "*". In this case: "-J" eliminates all the paths - bad because it also kills those after the "*" Here's my default that includes the whole d*mn path. /usr/local/bin/zip -r /usr/www/d3photography.com/htdocs/images/paidphotos/1284343047-Le-ach.zip /mount/archive/orders/Sep20/1284343047-Le-ach/download* 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). So how do I get it to store as "download/small/image.jpg" inside of the ZIP file instead of "mount/archive/orders/Sep20/1284343047-Le-ach/download/small/image.jpg". I only recently discovered this bug -- none of my clients have had the guts to tell me about it. ============== Just change the directory before you start zipping. cd /mount/archive/orders/Sep20/1284343047-Le-ach /usr/local/bin/zip -r /usr/www/d3photography.com/htdocs/images/paidphotos/1284343047-Le-ch.zip download* -- Matt Emmerton