MAC 주소, a4 : 1f : 72 : 6e : 2a : cf를 얻으려는 시도 (아래 참조)를 $ NewMAC 변수에 저장합니다. 이것이 발생하는 방법은 arp-scan이 텍스트 파일로 출력되도록하는 것입니다. 이것이 결과입니다.단어를 grep하는 방법 - bash?
Interface: eth2, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 1 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.100 a4:1f:72:6e:2a:cf (Unknown)
1 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.8.1: 1 hosts scanned in 0.143 seconds (6.99 hosts/sec). 1 responded
이 하나의 일! 고맙습니다! 하나의 부수적 인 말인데, MAC 주소의 문자를 대문자로 만드는 방법이 있습니까? – Vlad
@ user3525621 :'{print $ 2}'를'{print toupper ($ 2)} '로 바꾸거나'| tr '[: lower :]' '[: upper :]'' – mklement0