Skip to main content
7 events
when toggle format what by license comment
Apr 3, 2020 at 0:58 vote accept Sparhawk
Apr 2, 2020 at 10:19 comment added A.B I made an answer. I hope the explanation is ok to you
Apr 2, 2020 at 10:19 answer added A.B timeline score: 2
Apr 2, 2020 at 9:58 comment added Sparhawk @A.B Could you please explain in more detail? What do you mean by "the shell is now in"? Are you saying that apart from the exceptions you list, any other command is fed the target, and reads from /proc/$$/cwd?
Apr 2, 2020 at 9:20 comment added A.B when you do cd bar, it's already too late: the shell is now in /tmp/test/foo and nothing run from it will be able to know about bar. The only thing still knowing about bar is the shell itself (built-in pwd but not /bin/pwd, $PWD and its output in $PS1). To tell it otherwise, try: ls -l /proc/$$/cwd.
Apr 2, 2020 at 7:25 comment added Kusalananda It seems as if realpath, when the given pathname is a filename, does a pwd -P (equivalent) to get the current directory path. Prepending $PWD/ would be a solution, but an awkward one.
Apr 2, 2020 at 6:52 history asked Sparhawk CC BY-SA 4.0