Thursday, March 7, 2019

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.

Comments URL: https://news.ycombinator.com/item?id=19326224

Points: 2

# Comments: 1



from Hacker News: Newest https://ift.tt/2SJSlW0
via IFTTT

No comments:

Post a Comment

Acid attack victim was 'set up by his ex-wife'

A court hears Danny Cahalane, 38, faced "real threats" in the months before his death. from BBC News https://ift.tt/3cjZxC6 via...