Created
August 27, 2014 21:03
-
-
Save ehough/e3fb6687690a495cadef to your computer and use it in GitHub Desktop.
mp3 copier for head unit
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
dest_base="destination" | |
src_dir="src/" | |
atfile=0 | |
atdir=0 | |
for file in $src_dir/*; do | |
if ((atfile == 0)); then | |
dest_dir=$(printf "$dest_base/%0.5d" $atdir) | |
[[ -d $dest_dir ]] || mkdir -p $dest_dir | |
fi | |
cp $file $dest_dir | |
((atfile++)) | |
if ((atfile > 99)); then | |
atfile=0 | |
((atdir++)) | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment