ZSH: Get basename for for loop
<p>I'm trying to get the basename (without file extension) so that I can process a directory of audio files (.flac -> .m4a) quickly and and up with proper filenames. </p>

<p>So this works: </p>

<pre><code>for i in *.flac;do ffmpeg -i $i -c:a libfdk_aac -vbr 3 $i.m4a; done
</code></pre>

<p>But it leaves me with a file like like this: 
audiofile.flac.m4a</p>

<p>What I would like to do is just grab the "audiofile" part of the filename so that this works:</p>

<pre><code>for i in *.flac;do ffmpeg -i $i.flac -c:a libfdk_aac -vbr 3 $i.m4a; done
</code></pre>

<p>But I don't understand modifiers (apparently a ":t" modifier might get me the results?) or how to define variables on the for loop (for each file). Also, I see that there are many examples of how to do this with BASH, but I'm looking for something that works with zsh. </p>

<p>Any ideas? </p>

<p>Thanks! </p>