MKVMERGE: How to add subtitles to a mkv file #2

Regarding my previous post, here's a bash function to make it simpler:

function sub() {
    mkvmerge -o "${f%.*}_eng.${f##*.}" "$1" "$2" &&
    rm "$1" "$2"

"${f%.*}_eng.${f##*.}" is so that the file with the subtitles in it is renamed with _eng before the extension.

Then you just have to type 'sub $videofile $subfile', wait and you're done.