Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: tcsh -X behavior
- X-seq: zsh-users 3452
- From: Nemeth Ervin <airwin@xxxxxxxxxx>
- To: Vincent Lefevre <vincent@xxxxxxxxxx>
- Subject: Re: tcsh -X behavior
- Date: 13 Oct 2000 18:08:25 +0200
- Cc: zsh-users@xxxxxxxxxxxxxx
- In-reply-to: Vincent Lefevre's message of "Fri, 13 Oct 2000 17:29:56 +0200"
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <20001013172956.A16738@xxxxxxxxxxxxxxx>
- Sender: airwin@xxxxxxxxxx
Vincent Lefevre <vincent@xxxxxxxxxx> 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."
Messages sorted by:
Reverse Date,
Date,
Thread,
Author