about summary refs log tree commit diff stats
path: root/bin/metamv
diff options
context:
space:
mode:
Diffstat (limited to 'bin/metamv')
-rwxr-xr-xbin/metamv8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/metamv b/bin/metamv
new file mode 100755
index 0000000..3a2d8ba
--- /dev/null
+++ b/bin/metamv
@@ -0,0 +1,8 @@
+#!/bin/sh
+# usage: metamv FILE ...
+# e.g: metamv *.flac
+for file; do 
+	num="$(exiftool -m -p '$tracknumber$track' -- "$file")"
+	[ "$num" -lt 10 ] && num=0"$num"
+	mv -- "$file" "$num-$(exiftool -p '$artist-$title.$filetypeextension' -- "$file")"
+done