title: Bash script using awk in for loop
body: <pre><code>for i in $LIST
  do
    CFG=`ssh $i "cat log.txt|awk '{print $2}'"`
    for j in $CFG
    do
      echo $j
    done
  done
  </code></pre>
  
  <p>Say I want to print 2nd field in the log file on a couple remote host. In above script, print $2 doesn't work. How can I fix this? Thanks.</p>