title: Remove unnecessary slashes from a given path with bash
body: <p>How can I get rid of unnecessary slashes in a given path?</p>
  
  <p>Example:</p>
  
  <pre><code>p="/foo//////bar///hello/////world"
  </code></pre>
  
  <p>I want:</p>
  
  <pre><code>p="/foo/bar/hello/world"
  </code></pre>