echo and "-e"

Chris Pitchford <[email protected]> Tue, 20 Apr 2004 17:55:23 +0100 (BST)
Newsgroups gmane.comp.gnu.sh-utils.bugs
Message-ID <[email protected]>
Hi there

Bit of strange one I know but I can't get echo to display -e

---
# /bin/echo -e

# /bin/echo -e -e

# /bin/echo -- -e
-- -e
# /bin/echo "\-e"
\-e
# /bin/echo "\055e"
-e
# /bin/echo --version
echo (GNU sh-utils) 2.0
Written by FIXME unknown.

Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

---

Only noticed when writing a shell script that has argumens like
arg=-e
anotherarg=+e

/bin/echo "$arg"
/bin/echo "$anotherarg"

The samething works using Solaris 8's /usr/bin/echo which is why
I thought I should ask.

Shouldn't echo honour the "--" argument?

Just a curious thought

Cheers

Chris


Chris Pitchford <[email protected]>