two small bugs in the shell

Trek trek00 at inbox.ru
Fri Jan 22 09:01:48 UTC 2016


On Thu, 21 Jan 2016 10:34:34 +0000
Laszlo Papp <lpapp at kde.org> wrote:

> On Thu, Jan 21, 2016 at 10:27 AM, Ron Yorston <rmy at pobox.com> wrote:
> > Busybox echo follows GNU conventions for escape handling rather than
> > POSIX.
> Is that a good thing ?

actually the POSIX standard says that the results are implementation
defined if -n option or backslash are used with echo

the XSI extension requires echo without -n option but with escape
sequences

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html

the GNU echo recognizes -n and requires -e for escape sequences

https://www.gnu.org/software/coreutils/manual/html_node/echo-invocation.html


actually on my debian, -n is recognized by bash, busybox, dash, ksh (but
depends on PATH variable), mksh, posh and zsh, but not by yash

escape sequences are recognized by dash, mksh, posh, yash and zsh (in
ksh mode)

-e is required for escape sequences by bash, busybox, ksh, and zsh (in
sh mode), but it is not recognized by dash, posh and yash

so only yash is XSI conformant (on debian)


to answer your question, it's simply a choice, as echo is not portable
but it is present in the POSIX standard for historical applications

c-ya!


More information about the busybox mailing list