title: Linux Rename command uppercase first letter
body: <p>I'm writing a Bash script for cleaning up in my music.</p>
  
  <p>I wanted it to format all the file names and making them and so with a little internet search I wrote this line:</p>
  
  <pre><code>sed -i -e 's/[-_]/ /g' -e 's/ \+/ /g' -e **'s/\&lt;[a-z]/\U&amp;/g'** -e "s/$artist //g" -e "s/$album //g"
  </code></pre>
  
  <p>Which I used to add the file names to a text file and then sed it, but then I didn't know how to apply the new names to the files.</p>
  
  <p>So then I started experimenting with rename and managed to get the exact same result
  except for the bolded parts, which is supposed to make every first letter in a word uppercase.</p>
  
  <pre><code>rename 's/[-_]/ /g' * &amp;&amp; rename 's/\s+/ /g' * &amp;&amp; **rename 's/\s\w{1}/*A-Z*/g' *** &amp;&amp; rename 's/^\d+[[:punct:]]\s//g' * &amp;&amp; rename "s/$artist\s//g" * &amp;&amp; rename "s/$album\s//g" * &amp;&amp; rename "s/($ext)//g" *
  </code></pre>
  
  <p>Now, the code in rename is working (satisfactorily at least), finding only one letter after a SPACE character, but it's the replacement that is problematic. I've tried numerous different approaches, all leaving me with the result that the first letter in focus get exchanged to exactly A-Z in this case.</p>
  
  <p>In the rename manual page it says to make lower case uppercase you do 's/a-z/A-Z/g' but it's easy to figure that it only applies when it finds a-z A-Z.
  So this is what I need help with.</p>
  
  <p>A bonus would be if someone knows how to do it like in the sed example, where the \&lt; matches the beginning of each word, because at the moment, my rename command won't apply to the very first word and neither will it apply if there are multiple discs looking like "Disc name [Disc 1]" for obvious reasons.</p>