title: How to stop this script from moving renamed files out of source folder?
body: <p>The script works as far as renaming the files but it moves the renamed files out of their respective folders.</p>
  
  <p>I would like it to not move them but only rename them and I have failed after a few days of trying. I know this code is a mess and there is unneeded code in it but it nearly works.</p>
  
  <p>Also the renamed file isn’t getting an extension of <code>.txt</code> but that isn't really an issue for me. I just want to see the "Dynamic Range Value" that is taken from inside the file as the file name so I don’t have to open every file (a couple thousand albums worth) to see what the DR is. Here is the code:</p>
  
  <pre><code>#!/bin/bash
  cd /media/Storage/MusicWorks/Processing
  find . -name 'dr14.txt' | while IFS=$'\n' read -r i
  do mv -n "$i" `egrep -m1 -e 'Official DR value:' "$i" | sed -e 's/Official DR value://'`;
  echo "Done"
  done
  </code></pre>
  
  <p>I run this script from the terminal with a bash alias.</p>