Some shells like bash try to make '..' always work propery, namely, from home directory, cd ../$USER will place you in your home directory. Does bash always get this behavior correct?
Anyway can provide any example that bash doesnt work well?
Hi, thank you for your prompt response. I missed that condition. It is from the home directory and you type "..", and they meant to ask about ".." instead of $USER I guess.
I think there might be chance that bash fails on symbolic link?
So now, assuming that /foo does not contain two directories called bar and baz, we now have two symbolic links, /foo/bar and /foo/baz, that link to /some/long/path/name and /home/me, respectively. If we perform the following:
bash
cd /foo/bar
cd ../baz
we should end up in /foo/baz, which is really /home/me, because bash traced .. back up to /foo, not to /some/long/path/, as tcsh does (if I'm not mistaken; if not, it used to).
Ultimately, the question is, does bash always get this behavior correct? When cd-ing to another directory via a symlink, does cd .. always get you back to the directory that contains the symlink?