Tell HN: Bash 'pwd' has different results from /usr/bin/pwd
$ mkdir tmp1 ; ln -s tmp1 tmp2
$ ( cd tmp2 ; pwd )
/home/user/git/install/src/tmp2
$ ( cd tmp2 ; /usr/bin/pwd )
/home/user/git/install/src/tmp1
Apparently bash assumes the "-L" option by default, and coreutils assumes the "-P" option by default. So depending on whether you're running pwd from bash or shelling out to /usr/bin/pwd, you may get different results.
5 comments
[ 3.8 ms ] story [ 25.1 ms ] threadI wonder if there are ant security concerns to this.
To be fair, these aren't surprising because they're highlighted as such.
`help pwd` says
`man pwd` says