bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: sed awk bug


From: schwinge-list-gnu-utils-bug
Subject: Re: sed awk bug
Date: Thu, 29 Apr 2004 10:40:04 +0200
User-agent: Mutt/1.4.2.1i

On Wed, Apr 28, 2004 at 07:26:02PM -0400, Gary Knott wrote:
> Dear Gnu bug-fixer,
> 
> The sed command we need to replace zzz with & everywhere in the file F
> is:
> 
> sed -e s/zzz/\&/g F
> 
> But it does not work!

It works as expected.

> The & is still replaced by
> the matched pattern zzz, even though it is escaped.

\& is evaluated by the shell you're running.

You have to use either
$ sed -e s/zzz/\\\&/g F
or
$ sed -e 's/zzz/\&/g' F
to get it working for you.


Regards,
 Thomas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]