Skip to content

Instantly share code, notes, and snippets.

@ichpuchtli
Created September 29, 2013 00:09
Show Gist options
  • Save ichpuchtli/6747994 to your computer and use it in GitHub Desktop.
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
#!/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