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

Re: echo Bug?



Yang Xiao wrote:
> Discovered that on both FC3 and FC4 that /bin/echo -E doesn't work as it's
> described in the main page, the Shell buildin ones do work, except the one
> in ksh on FC4, which apparantly does not have a buildin echo command? had to
> install pdksh instead...really weird, can someone more knowledgeable please
> explain this?

For the audience, echo -e and echo -E are listed as turning on and off
recognition of certain "backslash-escaped characters".

It looks like you're getting confused between the various historical
versions of echo: System V and BSD versions did things differently.

http://moongroup.com/pipermail/shell.scripting/2003-February/008414.html
seems a fairly good reference to the confusion:
    Echo has two historic camps. Trust it not for weird stuff, but use
    it for simple stuff like "echo Hi Fred.".

Having said that, /bin/echo and bash both seem to follow the BSD-style
convention: you need to use -e to get /n to work. It's not surprising
they do things the same way: they're both traditional GNU utilities.

Incidentally:
[james kendrick ~]$ ksh
$ type echo
echo is a shell builtin

So ksh on Fedora *does* have echo builtin. man ksh says "the behavior of
echo is system dependent and print or printf described below should be
used". It's certainly different on FC4 and on AIX 5.2.

Hope this helps,

James.

-- 
E-mail address: james | "Drums must never stop. Very bad if drums stop."
@westexe.demon.co.uk  | "Why? What will happen if the drums ever stop?"
                      | "Bass solo."


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