My music library is arranged like:
/data/music/Artist_-_Album[alac]/*.m4a
I need to be able to keep a copy of these in another format (apple lossless) and I'd want that like:
/data/music/Artist_-_Album[flac]/*.flac
This one liner is good at traversing directories and converting items to flac, but it leaves all of the files in the source directory... not optimal.
for f in /data/music/**/*.m4a; do avconv -i "$f" "${f%.m4a}.flac"; done
How can I change/edit/add to this script to make the output files to into a different folder that is named appropriately as shown above?
/data/music/**/m4a/*.m4a
and/data/music/**/flac/*.flac
)?/data/music/*/m4a/*.m4a
and/data/music/*/flac/*.flac
)? If not you can use the same script from above (with some adjustments), otherwise a little more script fu is needed for an answer