i am woefully unfamiliar with awk. i am wanting to return whatever is in between 2 specific words in a string. I have this:
Code:
ip addr show external | grep inet
which gives me this:
Code:
inet xx.xx.xx.xx/22 brd 255.255.255.255 scope global external
I want to return that address between "inet" and "brd". So i do this:
Code:
ip addr show external | grep inet | awk 'BEGIN{FS="inet";RS="brd"}/</{print $2}'
Which i would think should work, as I've used that RS= FS= thing before with nearly-identical syntax and expected behavior, but here I get no output at all.
Ideas?