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

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