GNU bug report logs - #34447
`pwd` doesn't show real working directory if directory is renamed by another session

Previous Next

Package: coreutils;

Reported by: Chris Wright <chriswright96 <at> hotmail.com>

Date: Tue, 12 Feb 2019 00:35:02 UTC

Severity: normal

Tags: notabug

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chris Wright <chriswright96 <at> hotmail.com>
To: 34447 <at> debbugs.gnu.org
Subject: bug#34447: `pwd` doesn't show real working directory if directory is renamed by another session
Date: Mon, 11 Feb 2019 23:33:15 +0000
[Message part 1 (text/plain, inline)]
Hi,

I found that if a session's working directory is renamed or moved, `pwd` doesn't show the real working directory.

Example:

Session 1:

```
~/ $ mkdir test
~/ $ cd test
~/test $ touch file
```

Session 2:

```
~/ $ mv test test_2
~/ $ mkdir test
~/ $ cd test
~/ $ touch file2
~/ $ ls
file2
~/ $
```

Session 1 (still running during session 2):

```
~/test $ ls
file
~/test $ pwd
/Users/<user>/test
~/test $ realpath file
/Users/<user>/test_2/file
~/test $ realpath nonExistenFile
/Users/<user>/test_2/nonExistenFile
```

It seems that `realpath` does show the updated path, but `pwd` doesn't

Tested on MacOS (10.14.3) and Ubuntu 16.04 / 18.04

Thanks,
Chris
[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 87 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.