Machine Type: x86_64-pc-linux-gnu
Bash Version: 4.3
Patch Level: 11
Release Status: release
Description:
The cd command remembers where I came from, and "cd .." from a
symlinked directory comes back to the directory of the link. Wild card
expansion works differently and always reads the link target. I
understand the reason in general, but it would make sense that they
behaved the same when used on the command line.
Repeat-By:
I have the following directory hierarchy (-> denotes a symlink)
.
./a
./a/1
./a/11
./a/2
./b
./b/11 -> ../a/11
./b/2 -> ../a/2
./b/3
$ cd b/2
$ echo ../* # I'd expect to see "../11 ../2 ../3"
../1 ../11 ../2
$ cd ../*1* # changes pwd to a/1, expected b/11
$ cd ../.. # back to root
$ cd b/2/../*3* # should go to b/3
bash: cd: b/2/../*3*: No such file or directory
Fix:
When expanding file names on the command line, don't use symlink
targets but the actual paths (pwd or typed).