Last active
August 29, 2015 14:23
-
-
Save clathrop/8b3701bdc30f9caea729 to your computer and use it in GitHub Desktop.
This nifty script hunts for mp3 files within a specified dir (default is ~/Downloads) and moves them to the "Automatically Add to Itunes" folder in the ITUNES_HOME dir
This file contains 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 | |
# This nifty script hunts for mp3 files within a specified dir | |
# (default is ~/Downloads) and moves them to the "Automatically | |
# Add to Itunes" folder in the ITUNES_HOME dir | |
itunesAuto="${ITUNES_HOME}/iTunes Media/Automatically Add to iTunes/" | |
downloadsDir="${HOME}/Downloads" | |
files=$(shopt -s nullglob dotglob; echo $downloadsDir/*.mp3) | |
if(( ${#files} )) | |
then | |
for f in $downloadsDir/*.mp3 | |
do | |
echo "moving $f to $itunesAuto" | |
mv "$f" "$itunesAuto" | |
done | |
else | |
echo "No .mp3s in Downloads to move..." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment