bug-bash
[Top][All Lists]
Advanced

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

\w, $PWD and pwd builtin return "//" instead of '/'


From: mike b
Subject: \w, $PWD and pwd builtin return "//" instead of '/'
Date: Sun, 13 Jan 2019 01:52:03 +0100

Upon changing directory, with "//" passed as an argument, the trailing '/'
is still displayed when cwd is looked up by Bash:

bash-5.0# cd //
bash-5.0# pwd
//
bash-5.0# echo $PWD
//
bash-5.0# PS1=${PS1/\$/\w\\$}
bash-5.0//# # \w -> "//"
bash-5.0//# /bin/pwd  # <- coreutils implementation
/
bash-5.0//#

This seems to happen only when number of '/' char == 2, anything > 2 is
properly displayed as single '/' char.

Same is observed in 4.4.12.


reply via email to

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