Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [[ -x =command ]]



On Tue, 16 Oct 2007, Frank Terbeck wrote:

b) if not, what's the correct way to test if a command exists in the PATH?

[[ -x $(which most) ]] && echo yay || echo nay
=============

cool, thanks...

[[ -x $(whence -p most) ]] && export PAGER=$(whence -p most)


--
        ...atom

 ________________________
 http://atom.smasher.org/
 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
 -------------------------------------------------

	"War will cease when men refuse to fight."
		-- F. Hansen




Messages sorted by: Reverse Date, Date, Thread, Author