Monday, September 16, 2013

awk gsub for regular expression modification of strings

Use gsub like this

ping -c1 10.10.27.5 > /dev/null;arp 10.10.27.5 | awk '/ether/ {gsub(/:/,"",$3);print $3}'

No comments: