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
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.
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.