]> git.rmz.io Git - dotfiles.git/commitdiff
allow to set dir as parameter
authorSamir Benmendil <samir.benmendil@gmail.com>
Thu, 15 Nov 2012 13:34:23 +0000 (14:34 +0100)
committerSamir Benmendil <samir.benmendil@gmail.com>
Thu, 15 Nov 2012 13:34:23 +0000 (14:34 +0100)
bin/mkvsettitle

index 8afbee69cbea2aaa71023681a87894a6c263cf7b..71619c3860b5c09c086caba539413c2ed838f7be 100755 (executable)
@@ -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