Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A conditional test to see whether a function is loaded?
- X-seq: zsh-users 11540
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: A conditional test to see whether a function is loaded?
- Date: Sat, 09 Jun 2007 17:23:14 +0200
- In-reply-to: <fb3648c60706090816h5c5b6329o9bfc6af0baaa998a@xxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <4B761D89-02BE-4F7F-87C6-37331C89786B@xxxxxxxxxxxxxxxxxx> <20070609124520.GP3842@xxxxxxxxxxxxxxx> <46182.68.165.111.29.1181399341.squirrel@xxxxxxxxxxxxxxxxx> <fb3648c60706090816h5c5b6329o9bfc6af0baaa998a@xxxxxxxxxxxxxx>
fREW <frioux@xxxxxxxxx>:
> On 6/9/07, William Scott <wgscott@xxxxxxxxxxxxxxxxxx> wrote:
>> Frank Terbeck wrote:
>>
>> > zsh% [[ -n ${functions[promptinit]} ]] && echo yay || echo nay
>>
>
> I have a similar question. Is there a shorter, more zsh-y way to do:
> [[ -x `which aptitude` ]]
I'd write [[ -x $(which aptitude) ]], which means the same, but looks
better, IMHO. :-)
> Obviously replace aptitude with any program. I tried [[ -x =aptitude
> ]] but that gives error messages if it doesn't exist.
The reason this fails is, that the shell tries to expand =aptitude,
but if aptitude is not there, that fails, thus the error message.
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author