bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

echo(1) non-conformant (processing -e and -E)


From: Rich Felker
Subject: echo(1) non-conformant (processing -e and -E)
Date: Mon, 26 Nov 2007 22:51:32 -0500
User-agent: Mutt/1.4.2.2i

When running in POSIX/sh mode, bash should either disable the echo
builtin or stop giving special treatment to -e and -E. In particular,
POSIX provides well-defined behavior for:

echo -e
bash gives: blank line
posix gives: line containing only "-e"

echo -E
bash gives: blank line
posix gives: line containing only "-E"

echo -e -n
bash gives: no output
posix gives: line containing "-e -n"

POSIX leaves behavior unspecified when -n is the first argument, and
also when any argument contains backslashes. However, if conformance
to the XSI part of SUSv3 is also desired, -e must be default. I tend
to think this is stupid, which you probably agree with, so I have no
opinion on changing it to be XSI-conformant but I'm mentioning it
anyway for completeness.

Basically, my point is that bash, in POSIX/sh mode, should not provide
nonconformant builtins for POSIX commands which prevent potentially
conformant ones in the host system's path from being used. Either the
bash versions should be conformant or they should get out of the way
when in standards-conformant mode.

Rich




reply via email to

[Prev in Thread] Current Thread [Next in Thread]