Set mp3 date tag as YYYY-MM-DD based on mtime

Particularly useful for large, poorly tagged radio archives mirrored with wget.
Processes files in the working directory matching the patters specified.

Requires: mutagen (for tagging)

for FILE in *.mp3;  do mid3v2 --date=$(perl -e '@d=localtime ((stat(shift))[9]); printf "%4d-%02d-%02d", $d[5]+1900,$d[4]+1,$d[3]' $FILE) $FILE; done
“Command name is 25% fewer characters to type! Save days of free-time! Heck, it’s 50% shorter compared to grep -r.”