Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14422 > unrolled thread

Re: cd -L not behaving as documented with symlinks and ..

Started byChet Ramey <chet.ramey@case.edu>
First post2018-07-30 16:58 -0400
Last post2018-07-30 16:58 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: cd -L not behaving as documented with symlinks and .. Chet Ramey <chet.ramey@case.edu> - 2018-07-30 16:58 -0400

#14422 — Re: cd -L not behaving as documented with symlinks and ..

FromChet Ramey <chet.ramey@case.edu>
Date2018-07-30 16:58 -0400
SubjectRe: cd -L not behaving as documented with symlinks and ..
Message-ID<mailman.4435.1532984337.1292.bug-bash@gnu.org>
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    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web