# Intended purpose: Pipe birdc s p all into this script # initialize variable BEGIN { if (!pref) { pref="^p_"; } if (print_info=="") { print_info=0; } proto=""; print ""; if (print_info == 1) { print ""; } print ""; #rowspan='2' # print ""; } END { print "
PeertypestateInfo
importedexportedpreferred
"; } # default output for birdc, filter $1=="BIRD" || $1=="Name" { next } # if line begins with dn and is a BGP line $0 ~ pref && $2=="BGP" { proto=$1 print "" $1 "" $2 "" $4 ""; if (print_info == 1) { print "" $6 ""; } print ""; #rowspan='2' next } # for every other line "starting" a protocol /^[a-zA-Z]/ { # reset proto proto="" next }