Created
September 29, 2013 00:09
-
-
Save ichpuchtli/6747994 to your computer and use it in GitHub Desktop.
cpm3u - Copy each song in a m3u playlist to a directory i.e. cpm3u playlist.m3u /media/ipod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while read line; do | |
echo $line | grep -v "^#" > /dev/null || continue | |
size=`stat -c %s "${line}"` | |
totalsize=$((totalsize + size)) | |
done < $1 | |
echo "Total Size: $(($totalsize / (1024*1024)))M" | |
while read line; do | |
echo $line | grep -v "^#" && cp "${line}" "$2" | |
done < $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment