From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Ajeet D'Souza <98ajeet@gmail.com>, zsh-workers@zsh.org
Subject: Re: command cd doesn't work on some builds of zsh
Date: Tue, 13 Feb 2024 12:02:22 +0000 (GMT) [thread overview]
Message-ID: <814844550.3971658.1707825742843@mail.virginmedia.com> (raw)
In-Reply-To: <CAF6KdoXdvvhTUEcNf+XmjemdS1CDFzhs-gjze=R94_tcMzWbiQ@mail.gmail.com>
On 13/02/2024 11:48 GMT Ajeet D'Souza <98ajeet@gmail.com> wrote:
> Also, since the manpage mentions that command is supposed to invoke
> shell builtins, why does this command fail
> without POSIX_BUILTINS being set? Is cd not considered a builtin
> otherwise?
No, builtins are *only* invoked by "command" when POSIX_BUILTIN is set.
(As I said, native zsh uses "builtin", not "command", for restricting to
builtins.) The manual page is clear about this:
command [ -pvV ] simple command
The simple command argument is taken as an external command instead of
a function or builtin and is executed. If the POSIX_BUILTINS option is
set, builtins will also be executed but certain special properties of
them are suppressed. The -p flag causes a default path to be searched
instead of that in $path. With the -v flag, command is similar to
whence and with -V, it is equivalent to whence -v.
In your case the zsh "builtin" command is more useful, because as you
note you quite definitely don't want to execute the external command
"cd".
pws
next prev parent reply other threads:[~2024-02-13 12:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 9:54 Ajeet D'Souza
2024-02-13 10:05 ` Andreas Kähäri
2024-02-13 11:48 ` Ajeet D'Souza
2024-02-13 12:02 ` Peter Stephenson [this message]
2024-02-13 10:48 ` Peter Stephenson
2024-02-13 14:25 ` Lawrence Velázquez
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=814844550.3971658.1707825742843@mail.virginmedia.com \
--to=p.w.stephenson@ntlworld.com \
--cc=98ajeet@gmail.com \
--cc=zsh-workers@zsh.org \
/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).