On Thu, 10 Jun 2010 13:41:32 -0400
Lowell Gilbert <freebsd-questions-lo...@be-well.ilk.org> articulated:

> bash (like most other sh-style shells) has no "which" builtin.  You
> end up running /usr/bin/which.  bash (like most other sh-style
> shells) does have a (rough) equivalent, which is "type"

Personally, I have found the "command" equivalent quite adequate. I use
a version of the following in all of my Bash scripts that require
checking for the presents of another program.

command -v command1 >/dev/null && echo "command1 Found In \$PATH" || echo 
"command1 Not Found in \$PATH"

-- 
Jerry
freebsd.u...@seibercom.net

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__________________________________________________________________

Sure you can trust the Government; ask any Indian.
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to