title: Renaming files in bash script using mv
body: <p>I recovered many MOV files from a faulty hard drive however software named these files as per block location:</p>
  
  <p><strong>263505816.mov</strong> etc...</p>
  
  <p>I wrote a small script that uses mediainfo application so i can read date and time created and rename files accordingly:</p>
  
  <pre><code>for f in *.mov
  do
      MODIFIED=$(mediainfo -f $f |grep -m 1 "Encoded date" |sort -u |awk -F "UTC " '{print $2}')
      DATECREATED=$(echo $MODIFIED |cut -d' ' -f 1)
      TIMECREATED=$(echo $MODIFIED |cut -d' ' -f 2 |tr -s ':' '-')
  
      mv $f "$DATECREATED $TIMECREATED.mov"
  
  done
  </code></pre>
  
  <p>Which works fine but when i modify <strong>mv</strong> statement by adding 2 words at the end:</p>
  
  <pre><code>mv $f "$DATECREATED $TIMECREATED Holidays 2011.mov"
  </code></pre>
  
  <p>i get the following:</p>
  
  <pre><code>mv: target â  Holidays 2011.movâ is not a directory
  </code></pre>
  
  <p>I know i have to mark white spaces is some way because mv is mislead that it's a directory. Other articles do not mention using multiple variable in conjunction with mv that is why im asking for guidance. </p>
  
  <p>Many thanks,</p>