I want the output is "1-1" by grep in line by MAC Address So far i use this scripts, but doesn't work :SS-ID VLAN MAC TIME IP RSSI MODE UAPSD BW GI WMOS DHCP IDENTITY ----- ---- --- ---- -- ---- ---- ----- -- -- ---- ---- -------- 1-1 0 C4:46:19:75:C1:55 23m 192.168.5.253 -24 bgn no 20 S 4.9 ack* 1-2 0 5C:57:C8:69:8C:1E 3s 192.168.5.254 -38 bg no 20 L 4.8 ack*
Anybody can help ?my @macall = qw(print @input); foreach $line (@macall) { if ($line =~ /C4:46:19:75:C1:55:\s+(\S+)/) { $id = $1; } } print "ID = $id"; return (0);
In reply to grep in line and print by justbow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |