Re: bash scripting question

From: Chris F.A. Johnson (c.f.a.johnson_at_rogers.com)
Date: 08/10/03


Date: 10 Aug 2003 18:02:47 GMT

On Sun, 10 Aug 2003 at 17:57 GMT, Francisco wrote:
>> for n in *.mps
>> do
>> lame --decode "$n"
>> done
>>
>
> Thank you for all the responses, it was so simple.
> But I have a book called "Linux System Administration" by Vicky Stanfield
> and Roderick W. Smith that has the following example to play various wav
> files:
> for d in `ls *.wav`; do play $d; done
>
> And then a big "Warning":
> "This loop syntax uses spaces to delineate files, so if a filename includes
> a space, your script won't be able to parse the files correctly. [...] This
> is one of the reasons experienced Linux users don't create files with
> spaces in their names."

    Get a new book; that is NEVER the correct way.

> Instead of giving this simple solution to the problem it suggests to use
> file names without spaces in it. I dont understand why.

    Many scripts will fail when they have to deal with file names
    containing spaces; it's not hard to accommodate them, but their
    use is fairly recent (not to mention an abomination) and many
    scripts predate the influx of Windows-type file names.

-- 
    Chris F.A. Johnson                        http://cfaj.freeshell.org
    ===================================================================
    My code (if any) in this post is copyright 2003, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License


Relevant Pages

  • Re: Shadow of sundial a straight line on equinox day?
    ... Thank you all for all the responses. ... as I have difficulty trying to visualize all the descriptive sentences ... my sun dial is just a vertical stick. ... around equinox would be a straight line. ...
    (sci.astro.amateur)
  • Re: Sun Microsystems Survey
    ... communicates about technical, sales, and other issues. ... eligible to receive a $10 gift certificate via Hallmark Insights, ... Responses must be received by Sunday, December 16, 2007. ... or has anything to do with sun. ...
    (comp.unix.solaris)
  • Re: bash scripting question
    ... On Sun, 10 Aug 2003 at 06:13 GMT, Francisco wrote: ... > Say I want to decode with lame a lot of files in one dir, ...
    (comp.os.linux.misc)
  • Re: Sun Microsystems Survey
    ... communicates about technical, sales, and other issues. ... eligible to receive a $10 gift certificate via Hallmark Insights, ... Responses must be received by Sunday, December 16, 2007. ... or has anything to do with sun. ...
    (comp.unix.solaris)
  • Re: BBCis Horoscopes go AWOL
    ... Certain members of my family are highly annoyed! ... As usual we'll have to wait until the Sun comes out of Uranus. ... An excellent responses, pity it took you three days to think it up. ... Certauntly not with Mars coming into Virgo:O))) ...
    (uk.tech.digital-tv)