title: How to use awk to print columns in a loop?
body: <p>I have a multiple-column text output from some command, and want to print the columns one at a time, like:</p>
  
  <pre><code>#!/usr/bin/ksh
  
  typeset -i i=0
  while [[ $i -lt 5 ]]; do
    &lt;command 1&gt; |awk '{print $i}' |&lt;command 2&gt;
    i=$i+1
  done
  </code></pre>
  
  <p>I know <code>$i</code> is not the way to specify the i-th column in awk. What is the correct usage here?</p>
  
  <p>Say, the output from <code>command 1</code> is something like:</p>
  
  <pre><code>"abc" "def" "ghi" "jkm"
  "123" "456" "789" "0ab"
  "erf" "fad" "dae" "kjh"
  </code></pre>
  
  <p>The value is not necessarily 3-character long. Here is just for example.</p>
  
  <p>I want to get the 1st column to the 4th column in turn, to be used by <code>command 2</code>.</p>