Builtin command "cd" does not change cwd to the target directory if ksh guesses it's the current one

Solution Unverified - Updated -

Issue

Builtin command cd does not change current working directory to the target directory if ksh guesses it's the current one.

See the following (ksh is the login shell):

$ mkdir /tmp/a
$ touch /tmp/a/b
$ cd /tmp/a
$ ls
b
$ mv /tmp/a /tmp/a_moved
$ mkdir /tmp/a
$ cd /tmp/a
$ ls
b

If bash is the login shell, the ls command shows empty directory, as expected.

This behaviour happens with ksh93, whatever RHEL version (4, 5, 6) you are running.

Environment

Red Hat Enterprise Linux (RHEL) 4, 5, 6
ksh - all versions

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.