On Mon, Jan 07, 2008 at 11:41:35PM -0800, Gary Kline wrote: > On Mon, Jan 07, 2008 at 11:34:08PM -0600, Paul Procacci wrote: > > Is this what you mean? > > > > --------------------- > > #!/bin/sh > > > > STRING="mystring.gz" > > > > if [ ".gz" = "`echo \"$STRING\" | sed -n 's/.*\(\.gz\)$/\1/p'`" ]; then > > echo test; > > fi > > > > ----------------------- > > > > ~Paul > > > > Sorry. You get the credit for the predicate expression; Jon had the > simpler > (and more readable:) one. But yours is warm+fuzzy in it's cleverness > :-) > > gary > > > > -- > Gary Kline Seattle BSD Users' Group (seabug) | [EMAIL PROTECTED] > 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 > > _______________________________________________ > [email protected] mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Quite truthfully, I forget a lot about case/esac most of the time. It always seems to elude me. I guess it doesn't help that I'm a sed mongrel. And for what it's worth, I agree that what I provided wasn't pretty, but at least it gives everyone something to stare at for a while. ;P Have a good night all! ~Paul _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
