#!/bin/bash # MP2toMP3 converter # Thanks to Michel Quatron from the BxLUG MailingList # Now built into this script by O. La Rosa - 20-02-2008 - Public # # Converting all MP2 files: function all () { clear for i in `ls *.mp2` do lame --mp2input -h -b 256 $i $i.mp3 done for i in *.mp2.mp3; do mv "$i" "${i/%.mp2.mp3/.mp3}"; done ls -mpF *.mp3 |more exit } clear # Converting one MP2 file: read -p"MP2-to-MP3 converter Input (path/name.mp2) or ENTER for ALL (CTRL+C to quit): " IN test -z "$IN" && all read -p" Output (name.mp3) or ENTER to restart: " OUT test -z "$OUT" && exec $0 #lame --mp2input -h -b 128 $IN $OUT #lame --mp2input -h -b 192 $IN $OUT # -b 224 or -f if you prefer... lame --mp2input -h -b 256 $IN $OUT exit