[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quick sed question



charles@lunarmedia.net said:
> is there a sed expression that can parse just 'chg' from the following:
> 
> 	core1.chg-confg
> 
> and do it in one sed execution? the best i can do is:
> 
> 	echo core1.chg-confg | sed -e 's/.*\.//g' | sed -e 's/-.*//g'
> 
> is there shorter way?

    sed 's/^.*\.\(.*\)-.*$/\1/'

Steve
-- 
steve@silug.org           | Southern Illinois Linux Users Group
(618)398-7320             | See web site for meeting details.
Steven Pritchard          | http://www.silug.org/
-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.