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

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

Re: GNU sed Bug (Single Quotes in Comments Cause Errors)


From: Stepan Kasal
Subject: Re: GNU sed Bug (Single Quotes in Comments Cause Errors)
Date: Mon, 5 Sep 2005 20:31:26 +0200
User-agent: Mutt/1.4.1i

Hello,

On Mon, Sep 05, 2005 at 01:12:40PM -0400, Jonathan Levi MD wrote:
> Paolo, are you sure the problem is with the shell?

sure.
> echo $str | sed 's/H/M/ # script works if you delete this '  7

Sed is called with two parameters: the first one is quoted,
the second one is 7.  The first one is a sed script, the second one
is supposed to be a file name:

> sed: can't read 7: No such file or directory

... but the file "7" does not exist.

> echo $str | sed 's/H/M/ # script works if you delete this   7
>     s/lo/low/'        #                                      8

In this case, sed gets one parameter:

s/H/M/ # script works if you delete this   7
   s/lo/low/

which is a valid sed script.  The rest of the line 8 is a comment.

> the ' at line 5 is retained:

You can happily delete it, it's part of a comment.

HTH,
        Stepan Kasal




reply via email to

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