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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content