is there a /bin/sh method to tell the ending of a file

Gary Kline kline at magnesium.net
Mon Jan 7 21:09:44 PST 2008


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 at 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



More information about the freebsd-questions mailing list