Re: echo Bug?

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

 



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."


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux