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

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

Re: sed


From: Hans-Bernhard Broeker
Subject: Re: sed
Date: 1 Mar 2001 14:52:36 GMT

Craig Allsop <address@hidden> wrote:
> Hi.

> Is this the correct behaviour?

> echo test | sed "s/test/\\/"

> Under 4dos shell in Win98, Cygwin GNU version v1.18 gives: \
> Under 4dos shell in Win98, Cygwin GNU version v3.02 gives: char 9:
> Unterminated 's' command

I think it's not sed, but your shell that's causing these problems.
In particular, the behaviour of quoted strings may well not be what
you think it is: the \\ inside "" quotes may not survive unharmed.

> Under Linux, GNU sed version 2.05 same problem.
> Under Linux, GNU sed version 3.02 same problem.

In Linux, the problem almost certainly is caused by shell argument
handling. Note the difference in output:

acp3bf:~$ echo "s/test/\\/"
s/test/\/
acp3bf:~$ echo 's/test/\\/'
s/test/\\/

-- 
Hans-Bernhard Broeker (address@hidden)
Even if all the snow were burnt, ashes would remain.



reply via email to

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