bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cd: null directory


From: Greg Wooledge
Subject: Re: cd: null directory
Date: Thu, 31 Jul 2025 07:13:44 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Thu, Jul 31, 2025 at 12:58:57 +0200, Phi Debian wrote:
> 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
> ====

You seem to have the set -u option turned on for some reason.

hobbit:~$ ksh
$ echo "$KSH_VERSION"                                                         
Version AJM 93u+m/1.0.4 2022-10-22
$ echo $undefined

$ cd $undefined
$ set -u
$ echo $undefined
ksh: undefined: parameter not set
$ cd $undefined
ksh: undefined: parameter not set

In order to get the expected error, you would have to turn off set -u
and quote properly:

$ set +u
$ cd "$undefined"
ksh: cd: bad directory



reply via email to

[Prev in Thread] Current Thread [Next in Thread]