B
barjunk
I'm trying to do validation on a firewall rule. The rule looks like
this:
-A eth0-IN -i eth0 -s 192.168.0.0/24 -p tcp -m tcp --dport 22 -j
ACCEPT
I know I can use split(' ') to break up the above entry into small
parts, but what I really want is every other one.
So '-A eth0' should be one then '-i eth0' should be the next....etc.
I guess I could use split then step through the resultant array and
make another, but I thought there might be a better ruby style answer.
Thanks for any guidance.
Mike B.
this:
-A eth0-IN -i eth0 -s 192.168.0.0/24 -p tcp -m tcp --dport 22 -j
ACCEPT
I know I can use split(' ') to break up the above entry into small
parts, but what I really want is every other one.
So '-A eth0' should be one then '-i eth0' should be the next....etc.
I guess I could use split then step through the resultant array and
make another, but I thought there might be a better ruby style answer.
Thanks for any guidance.
Mike B.