How can I get rid of unnecessary slashes in a given path?
Example:
p=\"/foo//////bar///hello/////world\"
I want:
p=\"/f
your input:
p="/foo//////bar///hello/////world"
command to remove the irrelevant slashes:
echo $p | tr -s /
output:
/foo/bar/hello/world