Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> You don't need realpath

Yes you do (or a suitable alternative, e.g. GNU readlink).

> The `cd` into the directory + `pwd` is equivalent.

You won't know which directory to cd to without realpath. Just stripping off the filename does not get you the correct directory if the file itself is a symlink, which is a common use case.



Doh, you're right. Thank you for the correction.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: