Strange behaviour of the "cd" command

Xen list at xenhideout.nl
Tue Jul 11 16:17:17 UTC 2017


Ken D'Ambrosio schreef op 11-07-2017 17:55:
> The problem is with ksh -- specifically (I think) ksh's implementation
> of 'cd'.  I fired up ksh, and also created a /.cache directory (and a
> /.foo), and here are some results:
> 
> $ cd /.foo  # success
> $ cd /.cache # success
> $ cd /tmp # success
> $ cd ../.foo # failure
> ksh: cd: /foo: [No such file or directory]
> $ cd ../.cache # failure
> ksh: cd: /cache: [No such file or directory]
> $ cd ../tmp # success
> 
> The thing I find most telling is the error messages, themselves:
> "/foo: No such file or directory".
> My *guess* as to what is happening is that it is interpreting the
> leading "." as *the directory* ".", meaning "this directory", meaning,
> in this case, "root", thus the "directory" it's thinking about is
> "/foo", *not* "/.foo".
> 
> Congrats.  I could be wrong, but I do believe you've found a bug.

Or maybe it has all kinds of speed-up features that you might have 
triggered.




More information about the ubuntu-users mailing list