You are not logged in.
I'm still completely new to Bash. I'm looking to pass all the files under one given directory to mp3gain, but I want to scan them in sets of albums to use with the album tag -a, so I need a way to iterate over the individual sucdirectories, then perform mp3gain -a *.mp3 on each album folder individually, separate from the other subdirectories.
The directory is set up in the format:
~/music/artist/album/song.mp3
Could somebody point me in the right direction?
Offline
find $HOME/music/artist -maxdepth 1 -type d | while read dir; do
mp3gain -a "$dir/"*.mp3
done
Offline
#!/bin/bash
for artist in *; do
echo "$artist"
if [ -d "$artist" ]; then
cd "$artist"
for album in *; do
if [ -d "$album" ]; then
mp3gain -a -k -d 2.0 "$album"/*;
fi
done
cd ..
fi
done
To be executed in the top level directory of your collection (~/music).
Offline