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: Fri, 19 Apr 2002 05:31:17 -0700

   Date: Fri, 19 Apr 2002 05:46:18 -0600
   From: SoloCDM <address@hidden>

   "Brian J. Fox" stated the following:
   > 
   > Please try:
   > 
   > for i in "foo bar" bar "bar baz"; do rm -i "$i"; done
   > 

   In the attached script you'll notice I tried redirecting the data to a
   file and storing it in a variable.  Either way it doesn't work.  The
   files come out broken up in the for loop.  In the "echo $MFILES"
   they're not broken.

I say again:

for i in "$(find .)"; do echo "$i"; done

Brian

   -- 
   Note: When you reply to this message, please include the mailing
         list/newsgroup address and my email address in To:.

   *********************************************************************
   Signed,
   SoloCDM
   --------------28A7EE9FCD7005A08DF782CB
   Content-Type: text/plain; charset=us-ascii;
    name="sample"
   Content-Transfer-Encoding: 7bit
   Content-Disposition: inline;
    filename="sample"

   #!/bin/sh
   #

   #MFILES=`find $mredm -type f \( -iname *personal* -o -iname .*personal* \) 
-print | sed "s+ +' '+g"`
   #find $mredm -type f -maxdepth 3 \( -iname *personal* -o -iname .*personal* 
\) -print | sed -e "s+^+'+g" -e "s+$+'+g" > sample-data
   MFILES=`find $mredm -type f -maxdepth 3 \( -iname *personal* -o -iname 
.*personal* \) -print | sed -e "s+^+'+g" -e "s+$+'+g"`
   #echo $MFILES
   #exit 1
   #for f in `cat sample-data`
   for f in ${MFILES}
   do
           #/bin/./ls -hFlA "$f"
           echo $f
   done

   --------------28A7EE9FCD7005A08DF782CB--





-- 
== 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]