Skip to content

Instantly share code, notes, and snippets.

@dasgib
Created Sep 25, 2012
Embed
What would you like to do?
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