#!/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