On Thu, Dec 12, 2002 at 11:48:46AM -0500, Gerald Timothy Quimpo wrote:
[...]
> for dir in `ls`

On Thu, Dec 12, 2002 at 01:07:40PM -0500, Gerald Timothy Quimpo wrote:
> [tiger@tiger test]$ for fn in `ls -Q`; do echo $fn; done
> "11
> 22"/
> "aa
> bb"/
> 
> i guess that's bash splitting on spaces.  doing (note double quotes around 
> the `ls -Q`):
> for fn in "`ls -Q`";do echo $fn;done
> 
> doesn't work as i expect, i get both directory names on the same 
> line, e.g.
> 
> "11 22"/ "aa bb"/
> 
> how would i get them one directory to a line?

Randal Schwartz, the perl hacker, calls this "useless use of less".
You probably mean 

for var in *; do echo $var; done

when you write 

for var in `ls`; do echo $var; done"

Try it. It will work as you expect. :-)

HTH
-- 
$_=q:; # SHERWIN #
70;72;69;6e;74;20;
27;4a;75;73;74;20;
61;6e;6f;74;68;65;
72;20;50;65;72;6c;
20;6e;6f;76;69;63;
65;27;:;;s=~?(..);
?=pack q$C$,hex$1;
;;;=egg;;;;eval;;;
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to