Mail Archives: cygwin/2000/06/20/13:48:05
On Tue, Jun 20, 2000 at 09:56:17AM -0700, Bob McGowan wrote:
>Chris Faylor wrote:
>>
>> On Tue, Jun 20, 2000 at 10:35:03AM -0400, Zhiguang Qian 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 did. Have you tried it on UNIX? Same effect. It's not a bug.
>>
>> Your \\ is being eaten inside the ` ... ` command. You probably need
>> to double up on these when you are using them inside of backquotes (or
>> " style quotes for that matter).
>>
>
>I tried it too, but things didn't work as described above, from line
>one. After assigning to MY and doing a simple echo, bash printed:
>
> aaabbb.c
Yup. That's UNIX-shell 101. The \ is a quoting character. If you want to
use an actual \ you have to use \\, just like in C.
cgf
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -