bug-sh-utils
[Top][All Lists]
Advanced

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

Re: bug in echo util


From: Bob Proulx
Subject: Re: bug in echo util
Date: Wed, 30 Oct 2002 16:28:08 -0700
User-agent: Mutt/1.4i

Andrew Skiba <address@hidden> [2002-10-29 20:24:37 +0300]:
> I know this can hardly be called bug, but anyway... 
> 
> man echo promises me --version and --help command line options. Note 
> that man echo does not mention POSIXLY_CORRECT environment variable. 
> So when i tried  
>       $ echo --version 
> I got in the output 
>       --version 
> i.e. it does not treat --version as an option, but rather as a 
> regular argument, which must be printed. The same applies to --help 
> option. Version of sh-utils is 2.0.15-2mdk. Command 

You are confusing your shell's built in echo with the standalone
command.  A common confusion.  Try this.

  type echo

Probably you will see:

  echo is a shell builtin

If you are running the bash shell then try this bash specific lookup
for more information.

  type -a echo

Probably you will see:

  echo is a shell builtin
  echo is /bin/echo

Therefore you are not using the echo you thought you were using.  To
get documentation on the bash echo you can read the man or info page.
But there is also bash online help for bash builtins.

  help echo

You will see that the options there are different.

>       $ unset POSIXLY_CORRECT 
> has no effect. 

I am not aware of any effects of POSIXLY_CORRECT on the behavior of
echo.  Other commands do have behavior changes based upon the setting
of that variable, however.  But not all.

  http://www.gnu.org/software/fileutils/doc/faq/

Look for the section titled, "I am having a problem with kill, nice,
pwd, sleep, or test."  You are having the same problem but with 'echo'
instead.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]