Den ons 26 mars 2025 kl 06:23 skrev Dan <d...@nnnne-o-o-o.com>:
>
>
> Hello again,
>
> I do not not know if you ever cd enough like me passing by some sym
> links. Me, I am a little tired to create repos and countinuosly nock my
> head back cd against soft links.
>
> I explain myself better, given these piece of fs:
>
> /tmp/source_folder
> /tmp/source_folder/Public/index.php
> /tmp/source_folder/Public/static/js/index-js.php
> /tmp/repo
> /tmp/repo/source -> ../source_folder

There, "source" entry only exists inside "repo" folder

> from inside:
> /tmp/repo/source/Public/static/js/
>
> if I do:
> cd ../../../../source/Public
> this fails

..because this relative path does not enter into the "repo" folder,
and hence doesn't see 'source' softlink pointing to ../source_folder

> when I do:
> cd ../../../../source_folder/Public
> this is correct!

Yes, because this is following the "physical" structure of your dirs.

> Is this acceptable behavior or a kind of reversed-engineered bug
> ported in all the *nix systems? ;-)

Or, you just held the tool wrong and it failed for you because you did it wrong.

Your first example would have to be:
 $ pwd
/tmp/repo/source/Public/static/js
$  cd ../../../../repo/source/Public/
in order to work.

It might help in the future to look at differences between /bin/pwd
output and the shells builtin output of "pwd", when moving around
softlinked dirs, it can help that /bin/pwd often prints the "true
path" of where you are because it doesn't care which links you went
over, and the shell pwd shows the "way you got there" which may or may
not include softlinks to dirs.

$ pwd
/tmp/repo/source/Public/static/js
$ /bin/pwd
/tmp/source_folder/Public/static/js


-- 
May the most significant bit of your life be positive.

Reply via email to