While doing a naive path canonicalization I tried replacing "//" with "/", and so I wrote the following:
function canonicalize_path {
echo "${1//\/\//\/}"
}
When I run this in Ksh, I get:
ksh$ canonicalize_path "//home////foo"
\/home\/\/foo
But when I run it in bash, I get:
bash$ canonicalize_path "//home////foo"
/home//foo
I am extremely fine with us not being bash-compatible, but is that the expected behavior? It seems to go against the default assumptions regarding strings.