From: Colin P. McCabe Date: Mon, 19 Jun 2023 20:02:35 +0000 (-0700) Subject: music-to-mp3.sh: support multiple arguments X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=750b34b762ee5b95019fdb341ee41ce57e2966d6;p=cmccabe-bin music-to-mp3.sh: support multiple arguments --- diff --git a/music-to-mp3.sh b/music-to-mp3.sh index 0259f7b..2028e48 100755 --- a/music-to-mp3.sh +++ b/music-to-mp3.sh @@ -1,5 +1,6 @@ #!/bin/bash -FILE=$1 -echo "Re-encoding audio from ${FILE}..." -ffmpeg -i "${FILE}" -vn -ac 2 -ar 44100 -ab 220k -f mp3 "${FILE}.mp3" +echo "Re-encoding audio from ${@}..." +for FILE in "$@"; do + ffmpeg -i "${FILE}" -vn -ac 2 -ar 44100 -ab 220k -f mp3 "${FILE}.mp3" +done