title: inserting variables within my awk statement
body: <p>Here is a snippet of my awk statement..I'm trying to insert these 2 variables in the statement but they are not getting evaluated. Can someone point me in the right direction?</p>
  
  <pre><code>ZONE=`date "+%Z %Y"`
  DAY=`date "+%a"`
  
  awk '{if (NR&lt;2) {print "["$1, $2, $3"]"}}'
  </code></pre>
  
  <p>I'm trying this:</p>
  
  <pre><code>awk '{if (NR&lt;2) {print "[" $DAY, $1, $2, $3, $ZONE "]"}}'
  </code></pre>
  
  <p>This tip here helped solve my problem.</p>
  
  <p>Protect the shell variables from awk by enclosing them with "'" (i.e. double quote - single quote - double quote).</p>
  
  <p>awk '{print "'"$VAR1"'", "'"$VAR2"'"}' input_file</p>