sh reading line of log problem

I'm trying to read entire line into a variable, but seems the variable is returning each word.

The result I'm trying to get is
"block in quick all group 100"
But the below code is giving me:
"block"
"in"
"quick"
"all"
"group"
"100"

Code:
#!/bin/sh
#
for rules in `ipfstat -i | grep "group 100"` ; do
     echo "$rules"
done
 
If you really need a line-by-line approach:

Code:
ipfstat -i | grep "group 100" | while read line
do
echo ${line}
done

(this is a useless duplication though)
 
DutchDaemon said:
If you really need a line-by-line approach:

Code:
ipfstat -i | grep "group 100" | while read line
do
echo ${line}
done

(this is a useless duplication though)

This works. Exactly what I needed to manipulate each lines.
Thanks.
 
Back
Top