bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #57914] abspath does resolve symlink


From: Steffen Dettmer
Subject: [bug #57914] abspath does resolve symlink
Date: Wed, 1 Apr 2020 14:43:51 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36

Follow-up Comment #7, bug #57914 (project make):

Thank you all for your explanations. I think I now understand it correctly :)


[comment #6 comment #6:]
> Just as another proof that it's a feature of the shell: if you don't use the
shell's built-in pwd command but instead use /bin/pwd, you'll see that just
like make (also not a built-in command in the shell :-)) it shows the physical
path:

This one I know (already met in practice).

According to the documentation, it is just a matter of defaults: "pwd" w/o
args defaults to "pwd -L", but "/bin/pwd" to "/bin/pwd -P", but that are just
defaults:


sdettmer@RefVm3:/tmp $ cd /tmp/
sdettmer@RefVm3:/tmp $ mkdir /tmp/x1
sdettmer@RefVm3:/tmp $ ln -s /tmp/x1 foo
sdettmer@RefVm3:/tmp $ (cd foo && pwd -L && pwd && pwd -P)
/tmp/foo
/tmp/foo
/tmp/x1
sdettmer@RefVm3:/tmp $ (cd foo && /bin/pwd -L && /bin/pwd && /bin/pwd -P)
/tmp/foo
/tmp/x1
/tmp/x1
sdettmer@RefVm3:/tmp $ 


At least my /bin/pwd (GNU coreutils 8.26) is using $PWD from environment:


sdettmer@RefVm3:/tmp $ man pwd|grep -1 -- -L

       -L, --logical
              use PWD from environment, even if it contains symlinks

sdettmer@RefVm3:/tmp $ (cd foo && /bin/pwd -L && PWD="" /bin/pwd -L )
/tmp/foo
/tmp/x1


I guess the different defaults are needed for complex compatibility issues.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57914>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]