Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Copy new music files to a folder
#!/bin/bash
extarray=( mp3 flac ogg wmv wav ) ;
HOME=$1;
DESTINATION=$2;
#if [ $HOME == "/" || $HOME == $DESTINATION ] { exit 1 }
cd $HOME;
for i in "${extarray[@]}"
do
find ./ -iname "*.$i" -exec cp -nrv --parents \{\} $DESTINATION \;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.