bash scripting

James R. Van Zandt jrv at vanzandt.mv.com
Sun Oct 1 11:15:20 EDT 2000


Michael O'DonnellMichael O'Donnell writes:
>|  While running bash try invoking the builtin
>|  "help" command (just to get a sense of what
>|  bash is always standing by to help you with)

Cool!  And all this time I have been grepping through the bash man
page for this kind of detail.


jc at trillian.mit.edu writes:
>(I've heard rumors that some versions of some shells do the
>test  as a builtin, but I've had trouble verifying this.

In bash, use "type -a".  It's like "which", but it tells you about all
the accessible versions along bash's search path (it actually uses the
first one), including shell builtins and shell functions.  In this
case:

  type -a [
  [ is a shell builtin
  [ is /usr/bin/[

You can also run "ls -ltu `which [`" before and after a test script.
FWIW, ksh v5.2.14, ash 0.3.5 and sash 3.4 also have [ builtin.  

		- Jim Van Zandt
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list