#!/bin/bash
# Created by Vladimir Prieto 2008-06-15

# Exit with usage message unless specified file exists and is readable
[ -r "$1" ] || { printf "Usage: ${0##*/} <file.m3u> <destination>\n"; exit; }

# For the purposes of the loop, ignore spaces in filenames
old=$IFS
IFS='
'

# Get the files
for n in `cat "$1"`; do
        if [ ${n:0:1} == "/" ]
        then
		file=$(echo $n | tr ' ' '\ ')
		echo "cp $file $2" ;
		cp $file $2;
        fi
done

# Restore the IFS
IFS=$old

