From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1379 invoked by alias); 6 Aug 2012 22:21:43 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17196 Received: (qmail 22544 invoked from network); 6 Aug 2012 22:21:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at luo.ma does not designate permitted sender hosts) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:from:date:x-google-sender-auth :message-id:subject:to:content-type:x-gm-message-state; bh=3WeCQyN2+zaC+YUu7uNrdnHG11dAzPbeqE8CmJ5mwTk=; b=Ac/9cwJcsMR9BiafoqdgxO3ouWpz87HO+oT0CsrSpboppAXwvBzKGL+JpoA3FulY8c Jtgv7n2nSzx4/WMjlkkk6J/ijKehctyRbch2adtvk7tKeqNb55KScxW5I2eBvr792cOn BAzlcRFeupj+hxG4j3f4U4yQpOmEI8m3/iSIdlCdJJQM2QzNmK19jMmSpdCeLEl0xKs8 7PRTFdUYL8PLKGd3p3XQ0fPtsc92XAJvPWaoMw8aOEEtad8oU0atzpfie3vYpq/7jUtt kSBM/ClqXGaGigZaV+yJ5VTm3ai/aHO5D+iNOY2cqQ6RifWx7VJbpfW1BDU7qF+tiEG4 r2hg== MIME-Version: 1.0 Sender: tj@luo.ma X-Originating-IP: [108.72.103.19] From: TjL Date: Mon, 6 Aug 2012 18:13:47 -0400 X-Google-Sender-Auth: F4GgF40Cq0uDuohDPl6nCOMmIRU Message-ID: Subject: equivalent of "if (( $+commands[FOO] ))" for functions? To: Zsh Users Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQk2a+ChXGKLB5Ys781yaSmwRHNdMLmPt6DmHgkdMRgdTUIo4KeztRC3cvNjODl2crgS1O8c 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