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