#! /bin/bash # sets the title of all mkv videos to the filename without extension dir=${1-.} for f in "$dir"/*; do case "$f" in *.mkv) ext=mkv ;; *.webm) ext=webm ;; *) continue ;; esac t=$(basename "$f" "$ext") t=${t%.*} mkvpropedit --set title="$t" "$f" > /dev/null done