[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: possible sed problem(s)...
From: |
Andreas Schwab |
Subject: |
Re: possible sed problem(s)... |
Date: |
08 Aug 2001 20:44:37 +0200 |
User-agent: |
Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.0.105 |
address@hidden writes:
|> Hi there,
|>
|> I'm not sure that I've found a bug or not. The sed version is 3.02. I've
|> included 2 scripts that illustrate where my confusion lies.
|>
|> The script below is named tst1. The first echo? statement works as expected
|> but the second one does NOT. The only difference is the use of a double
|> quote in the first one and a single quote on the second one. Am I missing
|> something here?
Yes. Double quoted and single quoted strings differ in the set of special
characters. In single quoted strings only the single quote is special,
whereas in double quoted strings the special characters include the double
quote, dollar, backslash and backquote characters.
|> #!/bin/sh -xv
|>
|> echo 12345 | sed -e"/^1/a\\
|> 6789"
|>
|> echo 12345 | sed -e'/^1/a\\
|> 6789'
$ echo 12345 | sed -e'/^1/a\
6789'
12345
6789
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
address@hidden
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5