Skip to content

Instantly share code, notes, and snippets.

@dasgib
Created September 25, 2012 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dasgib/3782943 to your computer and use it in GitHub Desktop.
Save dasgib/3782943 to your computer and use it in GitHub Desktop.
Copy all songs in a .m3u file exported via iTunes to a new directory
IFS=$'\n'; mkdir playlist; for FILE in `tr "\r" "\n" < playlist.m3u | grep -v "^#"`
do
SONG=`basename $FILE`
ALBUM=`basename ${FILE/$SONG//}`
ARTIST=`basename ${FILE/$ALBUM\/$SONG//}`
cp $FILE "./playlist/$ARTIST - $ALBUM - $SONG"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment