It's actually worse than that. For example, try echoing \1 (slash and one), 
which shows up often when making sed scripts.
Here's what happens in dash-0.5.5.1:
$ echo '\1'
(outputs 0x01 0x0A, which is only visible with od)
Here it's incorrectly treated as an octal sequence, even though it does not 
begin with 0. \01 should be required for the above output, and no such 
processing should happen in single quotes anyway.
$ echo '\\1'
\1
Here It processes the escape sequence again in single quotes. bash would output 
\\1
$ echo '\\\1'
\
Both backslash and \1 are interpreted.
$ echo "\1"

Outputs 0x01 0x0A again.
$ echo "\\1"

Surprizingly outputs 0x01 0x0A. Where did that come from?

Overall, there simply is no way to output \1 into a sed script that will
work in both bash and dash.

-- 
Wrong escape character processing in dash
https://bugs.launchpad.net/bugs/268929
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to