Re: Couple possible bugs in echo
[email protected] (Bob Proulx) Wed, 19 Jun 2002 16:23:12 -0600
| Newsgroups | gmane.comp.gnu.sh-utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
> # echo "-n"
There has always been a split in the unix world. SysV uses echo "\c"
to avoid printing the newline while BSD uses echo -n to avoid printing
the newline. [If you need to avoid printing the newline it is better
to use 'printf' instead. It is portable and standard.]
> You get no output. I noticed that if you attempt to echo any of he options
> listed in the man page for echo they will be interpreted as options and not
> as the string you want to echo.
>
> I can't be sure if this is a bug or if there is some subtlety I am missing.
> I would include the version of echo I was using but that brings me to my
> second possible bug. When I type:
A subtlety. 'echo' is a builtin to the shell. /bin/echo is the
external standalone which is used when doing something like this
contrived example. Here there is no shell to be able to use a
builtin. This is why most builtin's have standalone versions too.
find . -type f -exec echo mv {} {}.old \; > /tmp/mvscript.sh
Use 'type' to find out which you are using.
type echo
echo is a shell builtin.
> # echo --version
>
> To get the version it echos --version
In order to make sure you are getting the GNU shellutils version you
can specify the full path.
/bin/echo --version
/bin/echo --help
> The man page is for sh utils 2.0 if that helps.
Check out this faq entry and I am sure it will answer your question.
If not then come back and ask again.
http://www.gnu.org/software/fileutils/doc/faq/#I%20am%20having%20a%20problem%20with%20kill
HTH
Bob