zsh-workers
 help / color / mirror / code / Atom feed
From: Martijn Dekker <martijn@inlv.org>
To: zsh-workers@zsh.org
Subject: Re: command -p should enable builtins not in path
Date: Mon, 24 Aug 2020 20:59:52 +0100	[thread overview]
Message-ID: <99d03601-babc-14c7-21b5-41a7a8c90eab@inlv.org> (raw)
In-Reply-To: <20200824183010.GA1728404@zira.vinc17.org>

Op 24-08-20 om 19:30 schreef Vincent Lefevre:
> However, "command cd" is not guaranteed to work in a POSIX shell,
> e.g. if $PATH has changed.

That's actually not true, 'cd' is intrinsically a built-in utility (it 
couldn't possibly function otherwise, as it must affect the current 
environment) and it is also explicitly exempt from a $PATH search by XCU 
2.9.1.4(d)[*] (not that most shells follow that absurd $PATH search rule 
for builtins anyway, but that's a different rant). Point being, POSIXly, 
'command cd' is safe.

- Martijn

[*] 
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01

-- 
||	modernish -- harness the shell
||	https://github.com/modernish/modernish
||
||	KornShell lives!
||	https://github.com/ksh93/ksh


  reply	other threads:[~2020-08-24 20:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 11:28 Vincent Lefevre
2020-08-21 13:03 ` Peter Stephenson
2020-08-21 15:49   ` Martijn Dekker
2020-08-21 16:08     ` Peter Stephenson
2020-08-21 16:35       ` Martijn Dekker
2020-08-24 18:30     ` Vincent Lefevre
2020-08-24 19:59       ` Martijn Dekker [this message]
2020-10-02 13:17         ` Vincent Lefevre
2020-08-21 15:47 ` Martijn Dekker

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=99d03601-babc-14c7-21b5-41a7a8c90eab@inlv.org \
    --to=martijn@inlv.org \
    --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).