bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing For Loop To Accept Spaces


From: Brian J. Fox
Subject: Re: Forcing For Loop To Accept Spaces
Date: Thu, 18 Apr 2002 12:42:06 -0700

Please try:

for i in "foo bar" bar "bar baz"; do rm -i "$i"; done

Brian

   Date: Thu, 18 Apr 2002 11:25:41 -0700
   From: Ian Macdonald <ian@caliban.org>
   Cc: Paul Jarc <prj@po.cwru.edu>

   On Thu 18 Apr 2002 at 12:11:47 -0600, you wrote:

   > Paul Jarc stated the following:
   > > 
   > > SoloCDM <deedsmis@aculink.net> wrote:
   > > 
   > > > How do I force a for loop to except files with spaces in their
   > > > names?
   > > 
   > > Quote the spaces.  (BTW, you mean "accept", not "except". "except" is
   > > nearly the opposite of what you mean.)
   > 
   > It didn't work.  Even with the quotes around the whole name it didn't
   > work.

   What are you using?

   This works for me:

   [ianmacd@caliban ~]$ for i in 'foo bar'; do echo $i; done
   foo bar

   Ian
   -- 
   Ian Macdonald               | Every man is as God made him, ay, and often
   ian@caliban.org             | worse.   -- Miguel de Cervantes 
                               | 
                               | 
                               | 




-- 
== The Difference Between Cultures: ==
    Einigkeit und Recht und Freiheit
    Liberte', E'galite', Fraternite'
    Sex, drugs and rock'n'roll



reply via email to

[Prev in Thread] Current Thread [Next in Thread]