Set mp3 tags of all files in a directory using current file name

Alec Jacobson

January 17, 2010

weblog/

This could probably get more elaborate and use the containing directories to set album and artist tags. For now here is a bash script to set the titles based on the current file name. This uses a program called tagmp3.
artist="Artist"
album="Ablum"
for filename in *.mp3; 
  do title=`echo $filename | sed 's/.mp3$//g'`; 
  tagmp3 set "%A:$arrtist %a:$album %t:$title" $filename; 
done