title: How to change file extension in Linux shell script?
body: <p>I've found some examples of doing this in similar situations, but this is the only shell-script I've written that does anything besides run commands verbatim, so I am struggling to apply the examples to my own situation and need some hand-holding &lt;3</p>
  
  <p>I'm just trying to batch rip audio from MP4s. This script works:</p>
  
  <pre><code>for f in *.mp4; 
      ffmpeg -i "$f" -f mp3 -ab 192000 -vn "mp3s/$f.mp3"
  done
  </code></pre>
  
  <p>But the files all end with .mp4.mp3. How can I get rid of the mp4 part?</p>