From owner-freebsd-questions@FreeBSD.ORG Tue Jan 8 05:09:43 2008 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 DEA1316A474 for ; Tue, 8 Jan 2008 05:09:43 +0000 (UTC) (envelope-from kline@magnesium.net) Received: from toxic.magnesium.net (toxic.magnesium.net [207.154.84.15]) by mx1.freebsd.org (Postfix) with ESMTP id D41A713C4CE for ; Tue, 8 Jan 2008 05:09:43 +0000 (UTC) (envelope-from kline@magnesium.net) Received: by toxic.magnesium.net (Postfix, from userid 1070) id BD06BDA828; Mon, 7 Jan 2008 21:10:58 -0800 (PST) Date: Mon, 7 Jan 2008 21:10:58 -0800 From: Gary Kline To: FreeBSD Mailing List Message-ID: <20080108051058.GA19698@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Subject: is there a /bin/sh method to tell the ending of a file 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, 08 Jan 2008 05:09:44 -0000 Hi All, Is there an easy way of determing whether a string//filename ends in *.gz? using /bin/sh? I spend around 20 minutes cobbling together scripts to burn ISO files last night. Then blindly wasted one CD-R file that was gzipped..... tar barfs on you,but cdrecord dev=foo.gz writes exactly that. I'd like to add a line that yells at me, then gunzips and does an MD5; then writes. (In C, no prob; C lets me fly, but not /bin/sh. But anyway, if any guru can clue me in, thanks. I think my brain is in Maui for a few days. tiam gary -- Gary Kline Seattle BSD Users' Group (seabug) | kline@magnesium.net Thought Unlimited Org's Alternate Email Site http://www.magnesium.net/~kline To live is not a necessity; but to live honorably...is a necessity. -Kant