title: Bash: Only one file processed with $1 but all with hard coded value
body: <p>This bash code working as expected (renaming file) with the hard coded value viz. <code>~/Music/*.mp3</code>. But it does not work (just processes only the first file) with <code>files=($1)</code> when I pass CLI argument: <code>./rfs.sh ~/Music/*.mp3</code></p>
  
  <p><strong><code>rfs.sh</code></strong></p>
  
  <pre class="lang-sh prettyprint-override"><code>files=(~/Music/*.mp3)
  
  for ((i=0; i&lt;${#files[@]}; i++)); do
      oldname="${files[$i]}"
      newname=`echo "$oldname" | sed -E 's/\/[0-9]+ /\//'`
      echo "$oldname ---&gt; $newname"
      mv "$oldname" "$newname"
  done
  </code></pre>