If you mean nested parentheses in (\(.*\)). The outer pair is literal, and the inner, escaped pair captures the string corresponding to the closed regular expression. Backreference \1prints this captured line. \2backreference prints a string captured by a second pair of escaped brackets.
, . , ^Host.*latency.*, . $!N , . MAC Address, ( ).
:
/^Host.*latency.*/{ - ,$!N - ,/MAC Address/{ - ,s/.*(\(.*\)) .*MAC Address: \(.*\) .*/\1 -> \2/ -
} - ,
} - ,/[Nn]map/d - ( ) ,s/^Host .*is up/& but MAC Address cannot be found/ -
source
share