From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8071 invoked from network); 13 Oct 2000 16:09:15 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Oct 2000 16:09:15 -0000 Received: (qmail 29841 invoked by alias); 13 Oct 2000 16:08:34 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3452 Received: (qmail 29833 invoked from network); 13 Oct 2000 16:08:34 -0000 X-Authentication-Warning: kempelen.iit.bme.hu: airwin set sender to airwin@inf.bme.hu using -f Sender: airwin@inf.bme.hu To: Vincent Lefevre Cc: zsh-users@sunsite.auc.dk Subject: Re: tcsh -X behavior References: <20001013172956.A16738@vin.ens-lyon.fr> From: Nemeth Ervin Date: 13 Oct 2000 18:08:25 +0200 In-Reply-To: Vincent Lefevre's message of "Fri, 13 Oct 2000 17:29:56 +0200" Message-ID: User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Vincent Lefevre writes: > Could we have the tcsh -X behavior in zsh conditional expressions? > > The tcsh manual says: > > X Executable in the path or shell builtin, e.g. ` - X > ls' and ` - X ls - F' are generally true, but `-X > /bin/ls' is not (+) You want probably the hash builtin: hash [ -dfmr ] [ name[=value] ] ... [snip...] value. For each name with no corresponding value, search for name in the path, and add it to the command hash table, and associating it with the discovered path, if it is found. So in a shell-script: if hash ls 2> /dev/null; then : fi -- Ervin "Intelligenti pauca."