Bug 6933

Summary: /bin/echo now requires '-e' arg to recognize escape characters
Product: [Retired] Red Hat Linux Reporter: Nishanth Thomas <nthomas>
Component: sh-utilsAssignee: bero
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 6.1CC: gafton
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-02-05 20:49:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nishanth Thomas 1999-11-11 18:27:46 UTC
In the sh-utils version 2.0 that is shipped with 6.1 the
echo.c source file has the following line:

/* #define V9_DEFAULT */

Because this is commented out the /bin/echo utility requires
that a '-e' flag be passed to enable escape character
recognition.  Following is an example of the behavior:

[nthomas@daisy src]$ /bin/echo "test\c"
test\c
[nthomas@daisy src[$

/bin/echo -e "test\c"
test[nthomas@daisy src]$

This is <IMHO> the _right_ behavior in a lot of ways (the
shell version does this), but many Linux users will find
their scripts are broken by this.  That is because in an
effort to avoid adding '-e' to their scripts they use the
following line:

[ -n "$BASH_VERSION] && { enable -n echo ; }

to enable the /bin/echo command instead of the shell echo
command.  Now that the two versions behave the same way they
are having a lot of problems with their existing code.

So, while I'm not sure this code can be called 'broken' it
does seem to favor a theoritical goodness over the needs of
the users.

(There have, btw, been 5 separate ISV complaints on this
one).

Comment 1 Bill Nottingham 2000-02-05 20:49:59 UTC
Unfortunately, the echo -e behaviour is a POSIX-ism, and
therefore won't be fixed.