Jim Meyering wrote: > Do you know of other uses of /bin/pwd that require -P's behavior?
About every script at my old employer used to use it in one way or another. Since that is my past employer I no longer have access to take an inventory. But it was quite a popular thing for people to do. As already noted most shells have a builtin pwd command. A script or command line call will use the builtin. By default both scripts and command line use will see the logical path. Therefore the only people this proposed change to /bin/pwd will effect are those that are intentionally calling out to /bin/pwd in order to get the external command. Why would people specifically avoid the builtin if the builtin is present? Because /bin/pwd operates differently from the builtin. More desireably. Because calling /bin/pwd returns the real canonical path. Basically I believe that changing /bin/pwd to use -L by default reaches out specifically to users who want the physical path and gives them the exact opposite of what they are trying to get. Which makes it a super painful change. Because anyone who already wanted the logical path is content with the shell builtin. The only people who call /bin/pwd are those escaping from the shell builtin. This proposed change will be exactly the opposite of what they want. And it only affects people who are trying to get the opposite behavior. It is also the exact opposite of very long standing traditional behavior. And as Pádraig noted different from some other venerable systems such as Solaris and I will also note HP-UX too. Is there any legacy Unix where /bin/pwd returns the logical path? What does *BSD do? For me now it is just something I tend to do from the keyboard. In my own bash environment I set "set -o physical" so I never have to be concerned about it. But when using someone else's environment if I type in pwd and know that it is lying to me then I routinely type in /bin/pwd in order to get the real path. I know that I could type in "pwd -P" now too. But my fingers know /bin/pwd. I can't believe I am the only one who does this. I don't see any significant positive for anyone. Is there a use case where changing /bin/pwd to -L by default actually benefits anyone? A use case that is currently disenfranchised by the existing behavior? Bob
