Stephane CHAZELAS wrote: > 2009-07-17, 13:09(-06), Eric Blake: >> According to Huang Tao on 7/17/2009 9:46 AM: >>> I'm not sure whether it is a bug >>> how can i echo the text string "-e" barely ( or "-n", "-E") >>> i tried >>> $echo "-e" >>> $echo '-e' >>> and some other inputs, all of which produced no outputs. >> Instead of using echo (which POSIX itself admits is fraught with >> portability problems), use printf: >> >> printf -- '-e\n' > [...] > > Note that it's a known non POSIX-conformance of bash. > > POSIX is explicit that > > echo -e > > Should output "-e\n".
That's why bash has the `xpg_echo' option. You can build bash in such a way that it's always enabled. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/