title: Renaming files with Bash, removing prefix and suffix
body: <p>I want to rename a bunch of files using bash, transforming this file pattern:</p>
  
  <pre><code>prefix - name - suffix.txt
  </code></pre>
  
  <p>Into this one:</p>
  
  <pre><code>name.txt
  </code></pre>
  
  <p>For that I wrote the following script:</p>
  
  <pre><code>find . -name "*.txt" | while read f
  do
    mv "${f}" "${f/prefix - /}"
  done
  
  find . -name "*.txt" | while read f
  do
    mv "${f}" "${f/ - suffix/}"
  done
  </code></pre>
  
  <p>It works, but I'd like to perform the renaming using a single loop. Is it possible?</p>