Thanks for your bug report.

As opposed to bash's or coreutils' echo, dash's echo is actually
conformant to POSIX/SUS. Since this is a conformance issue, and not a
bug, they will not be changing it: http://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=167893;archive=yes

The echo command is notoriously unportable across different shells and
environments. If you want to use echo portably, you should never use any
options (POSIX forbids them in general, but allows -n to be supported
either as an option or an argument; XSI requires it be interpreted as a
string argument); and you should never use backslashes (SUSv3 requires
them to be special, as in dash; POSIX allows either behavior, and
historically, System V interpreted them while treating -n as a string,
while BSD does not interpret them and treats -n as an option). In all
but the simplest of cases, printf(1) is much more preferable, being much
more consistent across implementations.

To be just a little clearer: for the _specific_ example you give above,
both versions of echo are complying with POSIX, but only dash is
complying with SUSv3. If you were to add the -n option, neither would be
complying with SUS. If you were to further add some other option, such
as -e, then only dash would be complying with POSIX.

** Changed in: dash (Ubuntu)
       Status: Confirmed => Invalid

-- 
dash improperly parses "\\n"
https://bugs.launchpad.net/bugs/121772
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

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

Reply via email to