If you use bash
${f%%.mp4}
will give the file name without the extension .mp4 .
Try using it as follows:
for f in *.mp4; do ffmpeg -i "$f" -f mp3 -ab 192000 -vn "mp3s/${f%%.mp4}.mp3" done
... and do not forget the do keyword, as in the example above.
Description
The bash manual ( man bash ) states:
$ {parameter% word} $ {parameter %% word}
Delete suffix pattern. The word expands to make the template the same as in the extension path. If the pattern matches the end of the extended parameter value, then the extension result is the expanded parameter value with the shortest matching pattern (case %'' case) or the longest matching pattern (the %% ') removed. If the parameter is @ or *, the template deletion operation is applied in each positional parameter one by one, and the extension is the resulting list. If the parameter is an array variable, adjusted using @ or *, the template deletion operation is applied to each member of the array in turn, and the extension is the resulting list.
This is just one of many string manipulations that you can perform with shell variables. All are called Extension Options .
This is also the section label specified in the bash manual. So man bash / paramter exp should get you there quickly. `
source share