#!/usr/bin/perl -w $|++; open( N, "route |") or die "$!\n"; my @out = (<N>); foreach my $line (@out){ my @words = split(/\s+/,$line); if($words[0] eq 'default'){ print "default-> $words[1]\n"; } }
In reply to Re: get default gateway
by zentara
in thread get default gateway
by robster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |