actum has asked for the wisdom of the Perl Monks concerning the following question:
so how can i make this in an for structure to avoid repetition? I have tried with arrays in arrays but no succes. Second I do not know how to expand an variable in an qx section.@inv0 = split(/\n/,qx'/usr/sbin/iptables -L DOWN0 -v -n -x | awk \'{ +print $8" - "$2}\' | egrep \'^192\''); @outv0 = split(/\n/,qx'/usr/sbin/iptables -L UP0 -v -n -x | awk \'{pri +nt $7" - "$2}\' | egrep \'^192\''); @inv1 = split(/\n/,qx'/usr/sbin/iptables -L DOWN1 -v -n -x | awk \'{p +rint $8" - "$2}\' | egrep \'^192\''); @outv1 = split(/\n/,qx'/usr/sbin/iptables -L UP1 -v -n -x | awk \'{pri +nt $7" - "$2}\' | egrep \'^192\''); @inv2 = split(/\n/,qx'/usr/sbin/iptables -L DOWN2 -v -n -x | awk \'{p +rint $8" - "$2}\' | egrep \'^192\''); @outv2 = split(/\n/,qx'/usr/sbin/iptables -L UP2 -v -n -x | awk \'{pri +nt $7" - "$2}\' | egrep \'^192\'');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: expanding variables in variables
by revdiablo (Prior) on May 22, 2006 at 16:18 UTC | |
|
Re: expanding variables in variables
by QM (Parson) on May 22, 2006 at 16:57 UTC | |
by suaveant (Parson) on May 22, 2006 at 18:14 UTC |