On 7/30/18 7:48 AM, Hugo Gabriel Eyherabide wrote:

> Bash Version: 4.4
> Patch Level: 0
> Release Status: release
> 
> Description:
> According to the documentation, cd -L should resolve symlinks after
> evaluating .., and that is indeed the case, unless the canonicalization
> fails, in which case it uses the original path, seemingly behaving as cd -P.
> 
> More specifically, suppose that in the current working directory /tmp there
> only exists a directory a/b and a symlink c->a/b. Then, cd -L c/../; pwd
> produces /tmp as expected. However, cd -L c/../b; pwd results in /tmp/a/b,
> as opposed to an error (because the directory /tmp/b does not exists).

Yes. Bash has used the directory name passed as an argument as a fallback
if canonicalization fails for a very long time (at least 25 years). POSIX
says this should fail, though, so when running in posix mode, bash returns
failure if the canonicalization fails.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to