From owner-freebsd-questions@FreeBSD.ORG Tue Jan 8 05:53:16 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 4831A16A417 for ; Tue, 8 Jan 2008 05:53:16 +0000 (UTC) (envelope-from pprocacci@datapipe.com) Received: from fmailhost03.isp.att.net (fmailhost03.isp.att.net [204.127.217.103]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8A313C448 for ; Tue, 8 Jan 2008 05:53:16 +0000 (UTC) (envelope-from pprocacci@datapipe.com) Received: from nat.myhome.net (adsl-157-61-28.bna.bellsouth.net[70.157.61.28]) by isp.att.net (frfwmhc03) with SMTP id <20080108055315H0300i23e4e>; Tue, 8 Jan 2008 05:53:15 +0000 X-Originating-IP: [70.157.61.28] Received: (qmail 6005 invoked from network); 8 Jan 2008 05:53:38 -0000 Received: from 2.21.5.10.in-addr.arpa (10.5.21.2) by 1.21.5.10.in-addr.arpa with QMQP; 8 Jan 2008 05:53:38 -0000 Date: Mon, 7 Jan 2008 23:53:31 -0600 From: Paul Procacci To: John Levine Message-ID: <20080108055331.GB95218@procacci.kicks-ass.org> References: <20080108053408.GA95218@procacci.kicks-ass.org> <20080108054753.90411.qmail@simone.iecc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080108054753.90411.qmail@simone.iecc.com> User-Agent: Mutt/1.4.2.3i Cc: "freebsd-questions@freebsd.org" Subject: Re: 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:53:16 -0000 /Gulp Guess I'm too `new` skool! ;-P Cheers! On Tue, Jan 08, 2008 at 12:47:53AM -0500, John Levine wrote: > >--------------------- > >#!/bin/sh > > > >if [ ".gz" = "`echo \"$STRING\" | sed -n 's/.*\(\.gz\)$/\1/p'`" ]; then > > echo test; > >fi > > Ewwww. I think that we can now safely take advantage of > features added to the shell in the late 1970s. > > ----------------------- > #!/bin/sh > > case "$1" in > *.gz) echo that is a gzipped file ;; > *) echo that is not a gzipped file ;; > esac > > -----------------------