David Ulevitch wrote:
> 
>   I am trying to do this:
>   $ns1_in = `/usr/local/sbin/iptables -xvnL |grep 'mrtg' |grep -v 'Chain' |grep 
>'ns1-in' |awk '{print $2}'`;
> 
>   but perl thinks the $2 is for it so it evals it (to '') and then awk
>   in return prints the whole line, as opposed to the $2 that I want.
> 
>   Escaping the $2 to \$2 didn't work.
> 
>   I know this could be done in perl, but I'm always one for the quick
>   and dirty CLI way first. ;-)


One way to do this to perl:

/mrtg/ and !/Chain/ and /ns1-in/ and $ns1_in = (split)[1] for 
`/usr/local/sbin/iptables -xvnL`;



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to