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 10:48:05 +0000 (GMT) [thread overview]
Message-ID: <1755424970.3965716.1707821285662@mail.virginmedia.com> (raw)
In-Reply-To: <CAF6KdoXAt7KWtCSJXj+Dk6Sw3v7-b0rxmGBb5BwTqvUnN5EMpg@mail.gmail.com>
> On 13/02/2024 09:54 GMT Ajeet D'Souza <98ajeet@gmail.com> wrote:
>
>
> Hi, I found inconsistent behaviour of the command builtin in some builds on zsh.
>
> On Fedora 39:
> $ zsh --version
> zsh 5.9 (x86_64-redhat-linux-gnu)
> $ zsh -c 'command cd'
>
> On Debian 10:
> $ zsh --version
> zsh 5.9 (x86_64-unknown-linux-gnu)
> $ zsh -c 'command cd'
> zsh:1: command not found: cd
>
> According to the manual, command cd should work:
> > Run command with args suppressing the normal shell function lookup. Only builtin commands or commands found in the PATH are executed.
>
> Any idea why different builds on zsh produce different outcomes here?
It's likely to be a difference in the setting of the POSIX_BUILTINS
option between the two cases. By default, with it off, "command"
doesn't apply to builtins --- you'd need to use "builtin cd" in
vanilla zsh to ensure it was running the builtin command.
With POSIX_BUILTINS set it'll find cd.
pws
next prev parent reply other threads:[~2024-02-13 10:48 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
2024-02-13 10:48 ` Peter Stephenson [this message]
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=1755424970.3965716.1707821285662@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).