[PLUG] which_command

Jeme A Brelin jeme at brelin.net
Wed Sep 1 17:57:02 UTC 2004


On Wed, 1 Sep 2004, Daggett, Steve wrote:
> Rich wrote:
> > On Wed, 1 Sep 2004, Marv wrote:
> > > How can I verify after the fact, what produced the output.
> > > Builtin or /bin/echo?
> >
> >   I do believe that the shell's built-in commands take precedence. If
> > you want to use the separate executable, specify the full path.
>
> I think Rich has it right.
>
>   If you type "echo --help" you get the built-in echoing the string
> "--help".  If you type "/bin/echo --help" you get the gnu help
> information.

Steve's approach is quite good, I think.  Here's the output of some
commands that might interest y'all:

jbrelin at shaft:~$ type -a echo
echo is a shell builtin
echo is /bin/echo
jbrelin at shaft:~$ echo --help
--help
jbrelin at shaft:~$ /bin/echo --help
Usage: /bin/echo [OPTION]... [STRING]...
Echo the STRING(s) to standard output.

  -n              do not output the trailing newline
  -e              enable interpretation of the backslash-escaped
characters
                    listed below
      --help      display this help and exit (should be alone)
      --version   output version information and exit (should be alone)

With -e, the following sequences are recognized and interpolated:

  \NNN   the character whose ASCII code is NNN (octal)
  \\     backslash
  \a     alert (BEL)
  \b     backspace
  \c     suppress trailing newline
  \f     form feed
  \n     new line
  \r     carriage return
  \t     horizontal tab
  \v     vertical tab

Report bugs to <bug-sh-utils at gnu.org>.

J.
-- 
   -----------------
     Jeme A Brelin
    jeme at brelin.net
   -----------------
 [cc] counter-copyright
 http://www.openlaw.org




More information about the PLUG mailing list