title: awk not printing the field expected... (at the moment nothing at all)
body: <p>I know this appears a bit much for what I am trying to receive but it is part of a greater script so it is necessary to have the two set of awk commands piped the way they are. </p>
  
  <p>Provided that I have an environment such as:</p>
  
  <p><code>interface=br1</code></p>
  
  <p>and my command being:</p>
  
  <pre><code>ip address show | awk '/\&lt;inet\&gt;/ { print $NF, '\t', $2 }' | awk '/\&lt;"$(echo $interface)\&gt;/ { print $3 }'
  </code></pre>
  
  <p>does anyone know why I can't get the appropriate IP output that I am expecting?</p>
  
  <p>EDIT: </p>
  
  <p>I wanted to edit this a bit to explain a bit more about what I am trying to do. I am pulling the information from <code>ip address show</code> to supply information to two different variables. </p>
  
  <p>One variable is chosen by the user. That is the interface name.  The second variable is derived from the user's choice. and that derivative is directly placed into another command which is to be run at the end of the sequence.</p>
  
  <p>To put it simply I am creating a commandline helper for virt-install.  </p>
  
  <p>The user chooses the bridge or interface they want to use with the VM and then that gets set to the <code>$interface</code> variable destined for the <code>--network=bridge:</code> flag. </p>
  
  <p>However the console redirect is directly affected by the interface chosen. Therefore I have substituted this command in its place:</p>
  
  <pre><code>NETWORK=ip address show | awk '/\&lt;inet\&gt;/ { print $NF, '\t', $2 }'
  .....
  echo "Please choose your bridge interface"
  $NETWORK
  printf "Interface: ": read interface
  ......
  --graphics vnc,listen=`$NETWORK | awk -v i=$interface '/\&lt;i\&gt;/ { print $2 }'`,port=5910,keymap=jp
  </code></pre>