zsh-users
 help / color / mirror / code / Atom feed
From: Nemeth Ervin <airwin@inf.bme.hu>
To: Vincent Lefevre <vincent@vinc17.org>
Cc: zsh-users@sunsite.auc.dk
Subject: Re: tcsh -X behavior
Date: 13 Oct 2000 18:08:25 +0200	[thread overview]
Message-ID: <gmv7l7c4tc6.fsf@kempelen.iit.bme.hu> (raw)
In-Reply-To: Vincent Lefevre's message of "Fri, 13 Oct 2000 17:29:56 +0200"

Vincent Lefevre <vincent@vinc17.org> 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."


  reply	other threads:[~2000-10-13 16:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-13 15:29 Vincent Lefevre
2000-10-13 16:08 ` Nemeth Ervin [this message]
2000-10-13 21:23   ` Vincent Lefevre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gmv7l7c4tc6.fsf@kempelen.iit.bme.hu \
    --to=airwin@inf.bme.hu \
    --cc=vincent@vinc17.org \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).