Skip to main content
4 events
when toggle format what by license comment
Apr 2 at 7:58 comment added sampi This answer is interesting, but may appear a bit misleading. While the kernel makes getcwd() always return a resolved path, that is kind of irrelevant because the environment variables are also inherited. When running cd $( mktemp -d ); mkdir directory; ln -s directory symlink; cd symlink; /bin/sh -c pwd, the child process will show itself being inside a path with the symlink still in the output. How realpath acts here is a consequence of how it is implemented, not of which information is accessible to it.
Apr 3, 2020 at 0:58 vote accept Sparhawk
Apr 2, 2020 at 10:28 history edited A.B CC BY-SA 4.0
renamed the function to a more appropriate name
Apr 2, 2020 at 10:19 history answered A.B CC BY-SA 4.0