title: How to use getline in AWK with a command that is concatenated together
body: <p>This is driving me insane. All I want to do is pass a command to the terminal from awk, where the command is a string concatenated together made from other variables.</p>
  
  <p>The documentation for awk says that something like</p>
  
  <pre><code>"echo" $1 | getline var
  </code></pre>
  
  <p>should put the value of $1 into var. But this is not the case. What am I missing here? </p>
  
  <p>I should add that I actually have a loop</p>
  
  <pre><code>for ( i = 1; i &lt;=NF ; i=i+1 )
  {
      "echo" $i | getline var
       printf var " "
  }
  
  printf "\n"
  </code></pre>
  
  <p>for inputfile like</p>
  
  <pre><code> 0 2
   1 2
  </code></pre>
  
  <p>outputs</p>
  
  <pre><code> 0 0
   0 0
  </code></pre>
  
  <p>what the hell.</p>