[KLUG Members] sed, regexp, and my tired brain

Dirk H Bartley bartleyd2 at chartermi.net
Wed Jun 1 09:29:51 EDT 2005


On Wed, 2005-06-01 at 09:21 -0400, Adam Tauno Williams wrote:
> I need to convert a string like
> // /usr/lib/fax/logo.mie       noff
> to
> espf[c]{/usr/lib/fax/logo.mie}
> 
> i've gotten as far as -
> sed "s/^\/\/ /epsf[c]{/"
> - which replaces the //

Try
sed -e "s/^\/\/ \([^ ]*\).*/$1/g"

interpret as sub line begin with "// " and replace with the stuff that
follows that until a space is found with.

Dirk


> 
> But I'm having a brain fart and can't come up with the reg exp to match
> up the remainder up to the first whitespace.
> 
> _______________________________________________
> Members mailing list
> Members at kalamazoolinux.org
> 



More information about the Members mailing list