state == 0 && /^-A/ {state=1; chain=$2; counter=1; printf "\n"} state == 1 && $2 != chain {chain=$2; counter=1; printf "\n"} !/^-A/ {state=0} state == 1 {printf "[%03d] %s\n", counter++, $0} state == 0 {print}
Hi there. Welcome to blog.oddbit.com
! I post articles here on a variety of technical topics. Mostly I’m posting for myself (writing things up helps me remember them in the future), but I always hope the content I put here is helpful to someone else. If you find something here useful and want to say thanks, feel free to buy me a coffee!