How can I get rid of unnecessary slashes in a given path?
Example:
p=\"/foo//////bar///hello/////world\"
I want:
p=\"/f
/foo/.//bar///hello/./world
work just fine.readlink -f
, but this will also canonicalize the symlinks in that path, so the result depends on your filesystem and the path supplied must actually exist, so this won't work for virtual paths.