about summary refs log tree commit diff stats
path: root/bin/metamv
blob: 3a2d8bae8e8127287091a3676aa0c707596358a9 (plain) (blame)
1
2
3
4
5
6
7
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