regex - How to extract all ifconfig data in awk except loopback -


i writing script includes function list interfaces except loopback ifconfig. logic i'm using loopback block regular expression , negating it. command use ifconfig|awk '!/lo:/,/\n\n+/' still returning interfaces. when remove !, loopback address returned. why earlier command returning instead of except loopback?

you can use awk:

ifconfig | awk 'begin{ors=rs="\n\n"} !/^lo/{print}' 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -