You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

15 lines
448 B

#!/bin/bash
for d in ./*; do
if [ -d "$d" ]; then
f=${d:2}
cd "$d"
echo ${f}.mp3
# find all mp3s, sort them (e.g. 100 after 99, not after 10),
# get only filenames, handle spaces, and pass list to mp3cat
find . -iname "*.mp3" -exec basename {} \; | sort -h | xargs -d '\n' mp3cat -c 1 -o "${f}.mp3"
# mp3cat -c 1 ./*.mp3 -o "${f}.mp3"
mv "${f}.mp3" ../
cd ..
fi
done