Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
equivalent of "if (( $+commands[FOO] ))" for functions?
- X-seq: zsh-users 17196
- From: TjL <luomat@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: equivalent of "if (( $+commands[FOO] ))" for functions?
- Date: Mon, 6 Aug 2012 18:13:47 -0400
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Sender: tj@xxxxxx
I only recently learned about this method of taking some action only
if the command 'FOO' is found:
if (( $+commands[FOO] ))
then
# take actions
fi
but what I am wondering is: is there a way to have this same sort of
check, except that it also includes zsh functions/aliases?
If yes, what's the syntax for that?
Otherwise I'll keep using 'which' and sending the output to /dev/null
but I figured it was worth asking.
Thanks!
TjL
Messages sorted by:
Reverse Date,
Date,
Thread,
Author