When I use the output of catting a file as the variable in a for-then
loop, the output of cat is broken along all spaces.  So, a line in a
file like:

71.112.211.167 - - [01/Jun/2006:00:03:06 -0700] "GET
/BENBRYAN-NEIL-BENB-RYAN-IMPACTENGINE/44/44211E9A-8412-61EC-E6F2-CC89F84887F6/gallery/image/9844/image.swf
HTTP/1.1" 200 4151 "-"

when called out like:

for i in $(cat /tmp/test.log); do echo $i; done

results in:

71.112.211.167
-
-
[01/Jun/2006:00:03:06
-0700]
"GET
/BENBRYAN-NEIL-BENB-RYAN-IMPACTENGINE/44/44211E9A-8412-61EC-E6F2-CC89F84887F6/gallery/image/9844/image.swf
HTTP/1.1"
200
4151
"-"

Why, and how do I keep the line whole?

-- 
***********************************************************************
* John Oliver                             http://www.john-oliver.net/ *
*                                                                     *
***********************************************************************


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to