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

Re: Simplest way to choose one of several commands



On Mon, 7 Sep 2009, Nikolai Weibull wrote:

Is there a simpler way of doing the following?

alias ls=${${(f)"$(whence -p {g,}ls)"}[1]}' --color'

I need to select gls, if thatÿÿs whatÿÿs installed, otherwise ls. (The code above assumes that at least ls is installed, which isnÿÿt a problem.)
===================

whence gls && alias ls="gls --color"



--
        ...atom

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

	"Religion is what keeps the poor from murdering the rich."
		-- Napoleon Bonaparte


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