On Sun, 28 Jan 2024 04:30:48 +0100 j...@jwo.cz wrote: > My opinion on this is that the ``cd ""'' command should fail with an > error in this case. The zsh is the only POSIX-compatible or > POSIX-shell-like shell that was available on machines to which I have > access that exhibits this behavior. > > I think that the empty argument can be relatively frequently caused by > substitution with some undefined variable -- it's better to warn the > user than to perform actions in the wrong directory. > > We risk that this will break some badly written scripts. > > I propose to make Bash report an error when the user attempts to cd into > empty string, possibly with an shopt option that allows changing > behaviour of the cd back to the current one -- silently ignoring the > command. > > Jiri Wolker. >
Related: https://austingroupbugs.net/view.php?id=1047 An associated issue is that there presently appears to be no way of suppressing the processing of CDPATH in bash. -- Kerin Millar