Clint Adams wrote:
On Fri, Oct 09, 2009 at 11:57:04PM +0400, Michael Tokarev wrote:
The dash's built-in echo command expands \nnn-style sequences, like
this:
$ echo 'a\165b'
aub
It looks like SUSv3 requires an initial 0 for the octal escapes.
SUSv3 tells the following:
If the first operand is -n, or if any of the operands
contain a backslash ( '\' ) character, the results are
implementation-defined.
So neither the auto-expansion of \-style sequences nor
the lack of -e option, nor even the -n option are required.
SUSv3 also tells about XSI, where echo should support -n,
\f\n\t-style symbolic escapes and indeed \0nn-style octal
sequences. It does not say about \nn or \xnn styles.
Is dash tries to follow XSI or SUSv3?
If the former, well, it will be a flamewar again, because
it's dangerous to use such shell (its echo built-in) as a
default /bin/sh (it's enough we've /usr/5bin/echo already
in every configure script for solaris, now we've also
/bin/echo especially for debian).
If it's the latter, let's make it conform to common practice.
Note that ash (the "parent" of dash) does not expand \-sequences
by default and understands -e.
Ref: http://www.opengroup.org/onlinepubs/000095399/utilities/echo.html
Most modern shells has an option to turn on that escape sequence
expansion, -e, and recognizes more escape sequences (like \xnn
hexadecimal sequences, \n\r\t symbolic sequences and so on).
That would be a violation of POSIX and thus a violation of Debian
policy.
Well, I didn't say that lack of -e support is a bug. See $subject.
/mjt
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org