Mac: Regular expression to parse scutil command output
You could try something like this:

scutil --nc show &lt;service id&gt; | sed -n '/IPv4/,/ExcludedRoutes/p' | sed '/ExcludedRoutes/,/{/d'



sed -n '/IPv4/,/ExcludedRoutes/p' will show text between IPv4 and ExcludedRoutes, both included.
sed '/ExcludedRoutes/,/{/d' will remove the ExcludedRoutes line.


The result will be like this:

$ cat file &lt;replace-with-your-command&gt; | sed -n '/IPv4/,/ExcludedRoutes/p' | sed '/ExcludedRoutes/,/{/d'
  IPv4 : &lt;dictionary&gt; {
    Addresses : &lt;array&gt; {
      0 : 10.20.15.181
    }