Bizarre bash problem

John Abreau jabr at abreau.net
Fri May 30 17:29:49 EDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Erik Price <erikprice at mac.com> writes:

> If you use "which" in shell scripts to determine the location of an 
> executable given its name, but you want to try using "type" instead, 
> you can make use of type with the -p option to avoid getting the 
> verbose output:
> 
> wintermute:~/down$ which bash
> /bin/bash
> wintermute:~/down$ type bash
> bash is /bin/bash
> wintermute:~/down$ type -p bash
> /bin/bash

Note that "type" shows you any available command, including aliases, 
shell built-ins, and shell functions, in addition to executable files 
that are in your PATH variable. 

The "-p" option tells it to only report commands in the PATH, and 
ignores functions, aliases, and built-ins. This is fine for a script, 
but I'd suggest you shouldn't develop a habit of using "-p" when you 
use it interactively on the command line. 


- --
John Abreau / Executive Director, Boston Linux & Unix
Email jabr at blu.org / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Exmh version 2.6 02/09/2003

iQCVAwUBPtfNTVV9A5rVx7XZAQKbVAP/fqgYdsKfp54JK8tmLY2wWlVpRV0QeML8
UKpOItCwp35a/BC6wKvYVN3WOFtO2/JK/HSorpdR+d3lhzUSATdz4ihe2t8Ixg3u
n65UINw5L7Qy4azGrstL4b+Ae3WnnN08RpT8EANx7tSmziWa/1wqCVvsKjTBeUtZ
VNS6EGoCr3c=
=H24R
-----END PGP SIGNATURE-----




More information about the gnhlug-discuss mailing list