Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: cd with empty argument does not conform to POSIX.1-2024 (Was: inherit OLDPWD from environment variable)
- X-seq: zsh-workers 53004
- From: Lawrence Velázquez <larryv@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: cd with empty argument does not conform to POSIX.1-2024 (Was: inherit OLDPWD from environment variable)
- Date: Tue, 23 Jul 2024 17:09:27 -0400
- Archived-at: <https://zsh.org/workers/53004>
- Feedback-id: iaa214773:Fastmail
- In-reply-to: <CAA=-s3xyZpiSXQz-pK1aVXVK6T00=8UOb1O_XdqUVGnVZHRMrQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <ffccf642-e5bc-4e22-9bb9-4ba3c20ccf1e@app.fastmail.com> <CAA=-s3xyZpiSXQz-pK1aVXVK6T00=8UOb1O_XdqUVGnVZHRMrQ@mail.gmail.com>
On Tue, Jul 23, 2024, at 11:47 AM, Mark J. Reed wrote:
>> The current behavior is to do nothing and exit with a zero status.
>
> For comparison purposes, note that this is also the current behavior of
> bash, even in POSIX mode.
This will be fixed in the next release; the development version [*]
already errors out:
% ./bash -c 'echo "$BASH_VERSION"; cd ""'
5.3.0(6)-alpha
./bash: line 1: cd: null directory
[*]: https://git.savannah.gnu.org/cgit/bash.git/tree/builtins/cd.def?h=devel&id=6c703092759ace29263ea96374e18412c59acc7f#n333
> Also dash.
Presumably a future release will fix this, given dash's explicit
goal of POSIX conformance.
> Whereas ksh does report an error ("bad directory") and exit
> with status 1.
This bolsters the argument for, at a minimum, updating ksh/sh
emulation via POSIX_CD, as does the fact that the Solaris 10
Bourne shell fails too.
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author