Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jan 2008 23:53:31 -0600
From:      Paul Procacci <pprocacci@datapipe.com>
To:        John Levine <johnl@iecc.com>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: is there a /bin/sh method to tell the ending of a file
Message-ID:  <20080108055331.GB95218@procacci.kicks-ass.org>
In-Reply-To: <20080108054753.90411.qmail@simone.iecc.com>
References:  <20080108053408.GA95218@procacci.kicks-ass.org> <20080108054753.90411.qmail@simone.iecc.com>

next in thread | previous in thread | raw e-mail | index | archive | help
/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
> 
> -----------------------



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