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

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

sed? escaping back slash


From: Craig Allsop
Subject: sed? escaping back slash
Date: Thu, 8 Mar 2001 08:10:12 +1000

Hi.

Is this the correct behaviour for sed?

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

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

Gives: \

Furthermore, if I wanted two back slashes in my replacement string, I try:

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

This results in only one slash. I need to use either seven or eight
backslashes to get just two in my substitution.

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

As far as I can see in the documentation, I need only supply one back slash
to escape a backspace in the replacement string.

Craig.






reply via email to

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