#!/bin/bash\ # itunes_sanity.sh - fix dir names created by iTunes\ # only works for mp3s, and not actually tested on a Mac\ # created by scruss on Sun Sep 4 22:05:00 EDT 2005\ # edited by vraa on 2007 july 2xsomething... find "$@" -type f | while read directory do firstfile=$( find "$directory" -type f -iname '*.mp3' | head -n1 ) artist=$( id3info "$file" | egrep ' TP1 ' | sed 's/=== TP1 (Lead performer(s)/Soloist(s)): ,,;' ) album=$( id3info "$file" | egrep ' TAL ' | sed 's,=== TAL (Album/Movie/Show title): ,,;' ) mv \'$directory\' \'$artist\ - $album\' done