Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jun 2010 15:08:23 -0400
From:      Jerry <freebsd.user@seibercom.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: Switched to Bash and Comparison of Shells
Message-ID:  <20100610150823.219c122c@scorpio>
In-Reply-To: <44typa3hv7.fsf@be-well.ilk.org>
References:  <1276190395.5437.53.camel@jane.spg.more.net> <44typa3hv7.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 10 Jun 2010 13:41:32 -0400
Lowell Gilbert <freebsd-questions-local@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.user@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100610150823.219c122c>