Is there a more Bashist way than echo $PWD// | sed -e 's#//\+#/#g' to replace repeating slashes with a single one?Thanks Steven D, now there's a fully working function to find the longest common path of two or more paths: path_common.
Collapse repeating characters
bash;string;replace
Not a Bash-only answer, but perhaps useful:echo $PWD/// | tr -s '/'