bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#34447: `pwd` doesn't show real working directory if directory is ren


From: Chris Wright
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

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]