On 24/04/14 14:26, Chris Walker wrote:
On Thu, 24 Apr 2014 13:34:21 +0100 steve-ALUG@hst.me.uk wrote:
On 24/04/14 12:21, Chris Walker 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?
Guessing here, but I think it's the spaces. If it's the spaces, you'll have to work out either a way to escape all of them with a "\ " (using sed perhaps?), or perhaps simpler, you may find that your distro accepts quotes.
Does for t in {01..15}*.ogg; do twolame -b 320 "$t" "$t.mp3"; done work?
Nope.
OK, you'll have to use SED then or something else. NB, you'll have to escape any spaces, and single quotes - that's probably why the single quote attempt failed. If you have any files with ? or * in and poss some other characters, you may have to escape them too. Good luck!
Or try Martijn's approach.
Steve