Bug of bash with sed operation ???

Chris Faylor cgf@cygnus.com
Tue Jun 20 09:51:00 GMT 2000


On Tue, Jun 20, 2000 at 09:15:58AM -0700, Earnie Boyd wrote:
>--- Zhiguang Qian <zqian@cisco.com> wrote:
>> Hi,
>> 
>> Here is the sample.
>> 
>> >>export MY=\aaa\bbb.c
>> >>echo $MY | sed -e 's#\\#\/#g'
>> >> /aaa/bbb.c
>> >>out=`echo $MY | sed -e 's#\\#\/#g'`
>> >> sed: -e expression #1, char 8: Unterminated `s' command
>> 
>> Try it.
>> 
>
>I just tried it and it worked for me in version 2.03.0(2).

I think that 2.03.0(20) must be broken then.  This isn't a bug.  The quoting
rules used in a `..` are different than the rules in '...'.  This fails on
every system that I tried this on.  The problem is that the \ handling is
done in the `...` before the '...'.  This is a typical problem with quoting
in a shell script.

At the very least the:

export MY=\aaa\bbb.c

is probably not doing what the user expects.  That is equivalent to:

export MY=aaabbb.c

cgf

>So, what are our differences?  It could be sed but I'm thinking that it is a
>bug introduced in bash-2.04.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list