The Sep 10, 2019 version of awk introduced a change in handling this:

  ifconfig egress | awk '/inet / {FS="[ .]"; print "host-"$4"-"$5"}'

Given a line like

        inet netmask 0xffffff00 broadcast

it used to return host-30-40, now it returns host-0xfffffff0-broadcast.
The new behaviour is the same as gawk and old behaviour can be obtained
by doing this instead

  ifconfig egress | awk -F '[ .]' '/inet / {print "host-"$4"-"$5}'

I don't know which is "correct" (the manpage isn't enlightening) but
it was a bit unexpected so I wanted to at least draw attention to it
in case it breaks somebody else's script.

Reply via email to