will be 123.123.123.123 Bcast (there are two <space>s between the last "3" and the "B").
Hi Joe,
In awkFS is a variable that contains an extended regular expression (aka ERE) that is used to match strings of one or more characters that are to be treated as field separators. The default value for FS is a single <space> character. That single <space> is an ERE with a special meaning only in awk that tells awk to ignore all leading and trailing <space>, <tab>, and <newline> characters in each record and treat each remaining sequence of one or more <space>, <tab>, or <newline> characters as a field separator. Note that you won't have any <newline> characters in a record if you're using the default record separator variable ( RS ) value (which is a <newline> character).
In an ERE, the <vertical-bar> character ( | ) separates two EREs and if either of those EREs are matched, the matched string is used as a field separator. In an ERE, the <plus-sign> following an ERE matching a single character causes the match to be performed on one or more characters matching the ERE it follows. So in the ERE " +|: ", the ERE before the <vertical-bar> (<space><plus-sign>) matches one or more adjacent <space> characters, the ERE after the <vertical-bar> (<colon>) matches exactly one <colon> character. And, with FS set this way, the input line:
will be split into fields as follows:
Field #1 will be the empty string before the 11 <space> characters at the start of the line, field #2 will be set to inet , field #3 will be set to 123.123.123.123 , field #4 will be set to Bcast , field #5 will be set to 123.123.123.123 , field #6 will be set to Mash , field #7 will be set to 255.255.255.0 , and NF (the awk variable specifying the number of fields in the current input record) will be set to 7.