Re: [expert] wav to mp3 enmasse?
On Tue, 2003-10-14 at 02:54, Brian Parish wrote: ... > Based on the above I would have thought that: > > #!/bin/bash > for i in *.OK; do mv $i $(basename $i .OK) > > would do it, but I get: > > line 3: syntax error: unexpected end of file > > Do I have too many dollars or something (this has never been a problem > before ;-) # for i in *.OK; do mv $i $(basename $i .OK); done -- Jack Coates Monkeynoodle: A Scientific Venture... Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
On Wed, 2003-10-15 at 01:54, Thomas Deutsch wrote: > Brian Parish <[EMAIL PROTECTED]> schrieb: > > > On Mon, 2003-10-13 at 23:00, bascule wrote: > > > basename will remove trailing suffixes: > > > mv $i $(basename $i .OK) > > > this removes '.OK' from the end of filenames but nowhere else > > > > > > bascule > > > > > > On Monday 13 Oct 2003 9:15 am, Brian Parish wrote: > > > > > > > for i in *.OK; do mv "$i" `echo $i | tr -d '.OK'`;done; > > > > > > > > removes the .OK just fine, but also removes ".", "O" and "K" wherever > > > > they occur. > > > > That's great, except that it seems that I need another scripting 101 > > lesson. > > > > Based on the above I would have thought that: > > > > #!/bin/bash > > for i in *.OK; do mv $i $(basename $i .OK) > > > > would do it, but I get: > > > > line 3: syntax error: unexpected end of file > > > > Do I have too many dollars or something (this has never been a problem > > before ;-) > > I think you must write "done" in a new line at the end. > > Greetings from Switzerland > > Thomas Thanks Thomas, Like I said - scripting 101! Works like a charm now. cheers Brian Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
Brian Parish <[EMAIL PROTECTED]> schrieb: > On Mon, 2003-10-13 at 23:00, bascule wrote: > > basename will remove trailing suffixes: > > mv $i $(basename $i .OK) > > this removes '.OK' from the end of filenames but nowhere else > > > > bascule > > > > On Monday 13 Oct 2003 9:15 am, Brian Parish wrote: > > > > > for i in *.OK; do mv "$i" `echo $i | tr -d '.OK'`;done; > > > > > > removes the .OK just fine, but also removes ".", "O" and "K" wherever > > > they occur. > > That's great, except that it seems that I need another scripting 101 > lesson. > > Based on the above I would have thought that: > > #!/bin/bash > for i in *.OK; do mv $i $(basename $i .OK) > > would do it, but I get: > > line 3: syntax error: unexpected end of file > > Do I have too many dollars or something (this has never been a problem > before ;-) I think you must write "done" in a new line at the end. Greetings from Switzerland Thomas _ This mail sent using V-webmail - http://www.v-webmail.org Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
On Mon, 2003-10-13 at 23:00, bascule wrote: > basename will remove trailing suffixes: > mv $i $(basename $i .OK) > this removes '.OK' from the end of filenames but nowhere else > > bascule > > On Monday 13 Oct 2003 9:15 am, Brian Parish wrote: > > > for i in *.OK; do mv "$i" `echo $i | tr -d '.OK'`;done; > > > > removes the .OK just fine, but also removes ".", "O" and "K" wherever > > they occur. That's great, except that it seems that I need another scripting 101 lesson. Based on the above I would have thought that: #!/bin/bash for i in *.OK; do mv $i $(basename $i .OK) would do it, but I get: line 3: syntax error: unexpected end of file Do I have too many dollars or something (this has never been a problem before ;-) cheers Brian Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
On Mon, 2003-10-13 at 09:00, bascule wrote: > basename will remove trailing suffixes: > mv $i $(basename $i .OK) > this removes '.OK' from the end of filenames but nowhere else > > bascule Thank you, I learned something good today. > On Monday 13 Oct 2003 9:15 am, Brian Parish wrote: > > > for i in *.OK; do mv "$i" `echo $i | tr -d '.OK'`;done; > > > > removes the .OK just fine, but also removes ".", "O" and "K" wherever > > they occur. -- ++ Mandrake HowTo's & More: http://twiki.mdklinuxfaq.org Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
basename will remove trailing suffixes: mv $i $(basename $i .OK) this removes '.OK' from the end of filenames but nowhere else bascule On Monday 13 Oct 2003 9:15 am, Brian Parish wrote: > for i in *.OK; do mv "$i" `echo $i | tr -d '.OK'`;done; > > removes the .OK just fine, but also removes ".", "O" and "K" wherever > they occur. -- "...[Arthur] leapt to his feet like an author hearing the phone ring..." -- Who says that the character of Arthur isn't autobiographical? Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
On Mon, 2003-10-13 at 01:53, Jack Coates wrote: > On Sun, 2003-10-12 at 06:27, Brian Parish wrote: > > On Thu, 2003-10-09 at 15:44, HaywireMac wrote: > > > On Sat, 04 Oct 2003 23:36:28 -0700 > > > Jack Coates <[EMAIL PROTECTED]> uttered: > > > > > > > hell, this is a one-liner :-) > > > > > > > > for i in `ls *.wav`; do lame -buncha -options $i; done > > > > > > alias that sucker in your .bashrc like this: > > > > > > function mp3enc() { for i in `ls *.wav`; do lame -buncha -options $i; > > > done } > > > > > > and in reverse: > > > > > > function mp3dec() { for i in *.mp3; do lame --decode $i `basename $i > > > .mp3`.wav; done; } > > > > > > the only problem you might run into is if the filenames have spaces, so, > > > do this first: > > > > > > for i in *.mp3; do mv "$i" `echo $i | tr ' ' '_'`;done; > > > > Being a total newb when it comes to shell programing, I found this to be > > a great tip (having just spent considerable time writing a much longer > > script to do the same thing *). > > > > Is there an equally simple way to truncate file names to remove unwanted > > characters from the end? I of course would never dream of downloading > > anything using gnutella, but should someone else do this and end up with > > lots of files ending in ".OK", it would be nice to process them in a > > similar way. Just theoretically of course. > > > > TIA > > Brian > > > > * It didn't work either! > > > > Try giving tr nothing as a second option, or use sed (challenging, > better get an O'Reilly book). > > Here's one that might help as an example: > [EMAIL PROTECTED] jack]$ cat bin/2lower.sh > #!/bin/sh > for i in * > do >j=`echo $i | tr '[A-Z]' '[a-z]'` >mv $i $j > done > > It comes in handy when installing Quake 2 maps that were built on > Winders :-) No, tried that. tr '.OK' '' complains that the second string cannot be null and says to use the -t qualifier when truncating. for i in *.OK; do mv "$i" `echo $i | tr -d '.OK'`;done; removes the .OK just fine, but also removes ".", "O" and "K" wherever they occur. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
On Sun, 2003-10-12 at 06:27, Brian Parish wrote: > On Thu, 2003-10-09 at 15:44, HaywireMac wrote: > > On Sat, 04 Oct 2003 23:36:28 -0700 > > Jack Coates <[EMAIL PROTECTED]> uttered: > > > > > hell, this is a one-liner :-) > > > > > > for i in `ls *.wav`; do lame -buncha -options $i; done > > > > alias that sucker in your .bashrc like this: > > > > function mp3enc() { for i in `ls *.wav`; do lame -buncha -options $i; > > done } > > > > and in reverse: > > > > function mp3dec() { for i in *.mp3; do lame --decode $i `basename $i > > .mp3`.wav; done; } > > > > the only problem you might run into is if the filenames have spaces, so, > > do this first: > > > > for i in *.mp3; do mv "$i" `echo $i | tr ' ' '_'`;done; > > Being a total newb when it comes to shell programing, I found this to be > a great tip (having just spent considerable time writing a much longer > script to do the same thing *). > > Is there an equally simple way to truncate file names to remove unwanted > characters from the end? I of course would never dream of downloading > anything using gnutella, but should someone else do this and end up with > lots of files ending in ".OK", it would be nice to process them in a > similar way. Just theoretically of course. > > TIA > Brian > > * It didn't work either! > Try giving tr nothing as a second option, or use sed (challenging, better get an O'Reilly book). Here's one that might help as an example: [EMAIL PROTECTED] jack]$ cat bin/2lower.sh #!/bin/sh for i in * do j=`echo $i | tr '[A-Z]' '[a-z]'` mv $i $j done It comes in handy when installing Quake 2 maps that were built on Winders :-) -- Jack Coates Monkeynoodle: A Scientific Venture... Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
On Thu, 2003-10-09 at 15:44, HaywireMac wrote: > On Sat, 04 Oct 2003 23:36:28 -0700 > Jack Coates <[EMAIL PROTECTED]> uttered: > > > hell, this is a one-liner :-) > > > > for i in `ls *.wav`; do lame -buncha -options $i; done > > alias that sucker in your .bashrc like this: > > function mp3enc() { for i in `ls *.wav`; do lame -buncha -options $i; > done } > > and in reverse: > > function mp3dec() { for i in *.mp3; do lame --decode $i `basename $i > .mp3`.wav; done; } > > the only problem you might run into is if the filenames have spaces, so, > do this first: > > for i in *.mp3; do mv "$i" `echo $i | tr ' ' '_'`;done; Being a total newb when it comes to shell programing, I found this to be a great tip (having just spent considerable time writing a much longer script to do the same thing *). Is there an equally simple way to truncate file names to remove unwanted characters from the end? I of course would never dream of downloading anything using gnutella, but should someone else do this and end up with lots of files ending in ".OK", it would be nice to process them in a similar way. Just theoretically of course. TIA Brian * It didn't work either! Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
On Sat, 04 Oct 2003 23:36:28 -0700 Jack Coates <[EMAIL PROTECTED]> uttered: > hell, this is a one-liner :-) > > for i in `ls *.wav`; do lame -buncha -options $i; done alias that sucker in your .bashrc like this: function mp3enc() { for i in `ls *.wav`; do lame -buncha -options $i; done } and in reverse: function mp3dec() { for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done; } the only problem you might run into is if the filenames have spaces, so, do this first: for i in *.mp3; do mv "$i" `echo $i | tr ' ' '_'`;done; you can alias that one as well in your .bashrc -- HaywireMac Registered Linux user #282046 Homepage: www.orderinchaos.org ++ Mandrake HowTo's & More: http://twiki.mdklinuxfaq.org ++ The truth is what is; what should be is a dirty lie. -- Lenny Bruce Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
On Sunday 05 October 2003 01:24 am, Rob Blomquist wrote: > Is there a tool for converting wav files to mp3s enmasse? > > Right now I am using Lame at the command line, but it is getting old. I > would like to point Lame at a directory of wavs and have it encode the mp3 > files using the same name. > > Any thoughts beyond a shell script? > > Rob Don't know about MP3 but if you can use OGG instead (and why not - it has higher quality, uses less space and is non-proprietary), then you can use oggenc like this: oggenc *.wav and it will change all the wavs to ogg with the original title. I always do a "oggenc -q 5 *.wav" to give it a bit higher quality, the default setting is 3, methinks. HTHs! :-) -- /\ Dark>Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
> Is there a tool for converting wav files to mp3s enmasse? > > Right now I am using Lame at the command line, but it is getting old. I > would > like to point Lame at a directory of wavs and have it encode the mp3 files > using the same name. > > Any thoughts beyond a shell script? There's a program called KBlade that works with bladeenc and KDE to allow drag and drop conversion. http://membres.lycos.fr/linzeus/kblade/ You can also make scripts inside the Gnome folder. If you select a file or directory then call the script it will get passed as a parameter to your script. You could then have your script convert everything in the passed directory. -- The Digital Hermit Unix and Linux Solutions http://www.digitalhermit.com [EMAIL PROTECTED] Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] wav to mp3 enmasse?
On Sat, 2003-10-04 at 22:24, Rob Blomquist wrote: > Is there a tool for converting wav files to mp3s enmasse? > > Right now I am using Lame at the command line, but it is getting old. I would > like to point Lame at a directory of wavs and have it encode the mp3 files > using the same name. > > Any thoughts beyond a shell script? > > Rob hell, this is a one-liner :-) for i in `ls *.wav`; do lame -buncha -options $i; done Gets a little trickier to recurse through directories, but I can show ya that too; just ask. -- Jack Coates Monkeynoodle: A Scientific Venture... Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
[expert] wav to mp3 enmasse?
Is there a tool for converting wav files to mp3s enmasse? Right now I am using Lame at the command line, but it is getting old. I would like to point Lame at a directory of wavs and have it encode the mp3 files using the same name. Any thoughts beyond a shell script? Rob -- Linux: For the people, by the people. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com