search_replace and sed

Reinhard bookreader at gmx.com
Wed Mar 24 05:50:48 PST 2004


On Wednesday 24 March 2004 13:04, alex at 22-music.de wrote:
> On 24.03.04 11:42 +0100, Reinhard wrote:
> > Hello,
> >
> > what is the best equivalent for <search_replace> ?
> > sed -i s/.../.../ filename
> > 	or
> > sed -i s/.../.../g filename
>
> The 'g' makes only one difference: without it, only one occurence of
> '...' in a line is replaced:
>
> AABBAA -> sed s/AA/CC/  -> CCBBAA
> AABBAA -> sed s/AA/CC/g -> CCBBCC
>
> That's all!

Sorry, I know that behaviour of sed - I wanted to know, how the behaviour of
<search_replace> is.

I suppose, it would match the sed s///g variant, I just wanted to ensure, that 
my guess is right.

Cheers Reinhard




More information about the alfs-discuss mailing list