Chris,
It isn’t the way you code, and it isn’t the way that you try, it isn’t the commands you say you run that makes twolame hate you so ... I close my eyes, and count to ten, but without leading zeros and when I open them I see missing quotes still here*
Try:
for t in $(seq -f '%02.0f' 1 15); do f=`ls ${t}*.ogg`; if [ -f "$f" ]; then twolame -b 320 "$f" "$f".mp3; fi; done
I haven’t got twolame around to test, but for example:
mak@crab cw $ touch '02 - I Close My Eyes And Count To Ten.ogg' mak@crab cw $ touch '03 - I Close My Eyes And Count To Eleven.ogg’ mak@crab cw $ for t in $(seq -f '%02.0f' 2 3); do f=`ls ${t}*.ogg`; if [ -f "$f" ]; then echo twolame -b 320 "$f" "$f".mp3; fi; done twolame -b 320 02 - I Close My Eyes And Count To Ten.ogg 02 - I Close My Eyes And Count To Ten.ogg.mp3 twolame -b 320 03 - I Close My Eyes And Count To Eleven.ogg 03 - I Close My Eyes And Count To Eleven.ogg.mp3
but I expect you also want to get rid of the “.ogg.mp3” from the result, so perhaps something like:
for t in $(seq -f '%02.0f' 1 15); do f=`ls ${t}*.ogg`; if [ -f "$f" ]; then t=$(echo "$f" | sed 's/.ogg/.mp3/'); echo twolame -b 320 "$f" "$t"; fi; done
— Martijn *) with apologies to Dusty Springfield
On 24 Apr 2014, at 12:21, Chris Walker alug_cdw@the-walker-household.co.uk wrote:
Hello,
I need more help please.
I'm trying to make my machine convert some .ogg files to mp3 using twolame (my distro doesn't have lame, only twolame) and I'm trying to do it like this :-
for t in {01..15}*.ogg; do twolame -b 320 $t $t.mp3; done
but it's failing with this message 'Usage: twolame [options] <infile> [outfile]'
All the filenames are like this '02 - I Close My Eyes And Count To Ten.ogg' with perhaps 15 or so tracks per folder.
In order to find my error, I tried this - for t in {01..15}*.ogg;do echo 'found tracks '$t;done and that lists all 15 tracks but despite hacking away for almost an hour, I can't persuade it to convert the files.
So what *should* I be typing to make this work?
-- __ __| |_ __ __ .----------------------------------------------. / _/ _` \ V V / | mailto:alug_cdw@the-walker-household.co.uk | ____,_|_/_/ |______________________________________________|
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!