#!/bin/bash

if [ -z "$1" ] || [ -z "$2" ] ; then
        echo Usage: $0 FILENAMES DESTINATION
        exit 1
fi
file=$1
dest=$2

for windows_path in $(ls $file); do
	echo "processing $windows_path"
	windows_filename=$(basename $windows_path)
	final_filename=$(echo $windows_filename | sed s/W/U/g)
	input_directory=$(dirname $windows_path)
	final_path="${dest}/${final_filename}"
        #output_file=`echo "$input_file" | sed 's/-\([0-9]*\)\.m4a/_\1\.m4a/g'`
	if [ -f "$final_path" ] ; then
		continue
	fi
        cp -n $windows_path $final_path
done
