On Thu, Jul 31, 2025 at 9:28 AM Andreas Kähäri <andreas.kah...@abc.se>
wrote:

> On Thu, Jul 31, 2025 at 09:01:30AM +0200, Phi Debian wrote:
>
>
> https://www.austingroupbugs.net/view.php?id=1047
>
>
Thanx for the pointer, so the rationale seems to be (citing the ref)

====
This is bad because many scripts do:

cd "$dir" || exit 1
====


amazingly I read this in there further down

====
* ksh93 always treats cd "" as an error
...
* ksh88 treats cd "" as cd "$HOME"
====

The ksh93 assertion is untrue (false) ksh93 behave like ksh88 in this area.

$ echo $KSH_VERSION
Version AJM 93u+m/1.1.0-alpha+11981f5f/MOD 2025-06-22
$ cd /tmp
$ cd "" ; pwd
/home/phi

So ksh93 treat cd "" as ksh88 does, i.e cd "" is equivalent to cd # no args.

However may be the author of the ref meant

ksh93 always treats cd "$undefined" as an error, this is true but the error
is not related to cd
====
TC$ echo $KSH_VERSION
Version AJM 93u+m/1.1.0-alpha+11981f5f/MOD 2025-06-22
TC$ cd $Undefined
./arch/linux.i386-64/bin/ksh: Undefined: parameter not set
TC$ cd "$Undefined"
./arch/linux.i386-64/bin/ksh: Undefined: parameter not set
====

The new bash behavior is not orthogonale

====
$ cd /tmp
$ cd "" && pwd
bash: cd: null directory
$ cd "$Undefined" && pwd
bash: cd: null directory
$ cd $Undefined && pwd
/home/phi
===

So the proposition that this new bash behavior be confined to POSIX mode
only, because POSIX draft seems confused in its rationale assertions.

In all case update the docco (and help) to reflect all the subtile
invocations...

Reply via email to