How can I get rid of unnecessary slashes in a given path?
Example:
p=\"/foo//////bar///hello/////world\"
I want:
p=\"/f
With realpath:
realpath -sm $p
Parameters:
-m, --canonicalize-missing no components of the path need exist -s, --strip, --no-symlinks don't expand symlinks