Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 6933 - /bin/echo now requires '-e' arg to recognize escape characters
Summary: /bin/echo now requires '-e' arg to recognize escape characters
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: sh-utils
Version: 6.1
Hardware: i386
OS: Linux
high
medium
Target Milestone: ---
Assignee: bero
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-11-11 18:27 UTC by Nishanth Thomas
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-02-05 20:49:18 UTC


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.