title: What does ${i%.*} do in this context?
body: <p>I'm learning a bit about running a bash script in a linux terminal, specifically in the context of converting audio video files.</p>
  <p>I came across this command here on SO that does exactly what I want. However, I'd like to understand it better:</p>
  <p><code>for i in *.avi; do ffmpeg -i &quot;$i&quot; &quot;${i%.*}.mp4&quot;; done</code></p>
  <p>Now, this is obviously a <code>for-loop</code> and I get the first <code>*</code> wildcard. I get the <code>do</code> block. But what I don't quite understand is <code>${i%.*}</code>. Specifically, what does the <code>%.*</code> bit do in the output location? Why not use <code>${i}.mp4</code> instead?</p>