From: Samir Benmendil Date: Thu, 15 Nov 2012 13:34:23 +0000 (+0100) Subject: allow to set dir as parameter X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/3355979d8bc66c57f1237ba35f2560d8f3cc371d allow to set dir as parameter --- diff --git a/bin/mkvsettitle b/bin/mkvsettitle index 8afbee6..71619c3 100755 --- a/bin/mkvsettitle +++ b/bin/mkvsettitle @@ -1,7 +1,8 @@ #! /bin/bash # sets the title of all mkv videos to the filename without extension -for f in *.mkv; do - t=${f%.mkv} - mkvpropedit --set title="$t" "$f" +dir=${1-.} +for f in "$dir"/*.mkv; do + t=$(basename "$f" .mkv) + mkvpropedit --set title="$t" "$f" > /dev/null done