From 018569a6e5783672db7763b0762afe194a585aa3 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 14 Nov 2008 16:18:28 -0800 Subject: Use grep -c rather than running wc command Grep already has a count option, so use it. --- scripts/vyatta-interfaces.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index c8e23a8..43f5f96 100644 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -65,7 +65,7 @@ if (defined $op_dhclient) { op_dhcp_command($op_dhclient, $dev); } sub is_ip_configured { my ($intf, $ip) = @_; - my $wc = `ip addr show $intf | grep $ip | wc -l`; + my $wc = `ip addr show $intf | grep -c $ip`; if (defined $wc and $wc > 0) { return 1; } else { -- cgit v1.2.3