title: how to remove specify characters at the end of string?
body: <p>I have some paths like so:</p>
  
  <pre><code>/dir
  /dir//
  /dir///
  /path/to/dir
  /path/to/dir/
  /path/to/dir///
  /path/to/dir/////////
  </code></pre>
  
  <p>I want to make it clearer using bash. I want to remove all <code>/</code> characters at the end of path and having:
  <code>/path/to/dir</code> or <code>/dir</code> without <code>/</code> at the end.</p>