Hello. As you can see, I'm a newbie here, and I need some help with the bash scripting... so I figured this would be the best place to ask.
Anyway, I'm trying to make a script that would recursively travel through the directory tree (starting with the current dir, from where it was run), and do something in that dir.
For example, I'd like to run through my entire MP3 music collection, and scan the contents of each directory with mp3gain as if each dir was an album. This means I have to cd into each directory (or something like that), and mp3gain all the .mp3 files in it as an album.
What I've come up with until now is this:
Code:
for i in "$(find . -type d)";
do
mp3gain -o -a -k -w "$i"/*.mp3
done
However, this doesn't do much, since it just says it can't open any *.mp3 for reading.
Can someone please help?
Many thanks.