When I am giving the following command -
ip -br -c addr show | awk '{print $2}'
It returns something like this output -
UNKNOWN
UP
DOWN
UP
UP
UP
UP
but when I want to only print the ones which are UP and I say -
ip -br -c addr show | awk '$2 == "UP"'
it does not return anything.
I have used awk with such comparisons and it works, here I am wondering may be -br
does not return a comparable string. Or is there something I am doing wrong.