title: printing variable inside awk
body: <p>In this script , I want awk to print the variables <code>$file</code>, <code>$f</code>, <code>$order</code> and <code>sum/NR</code> (all in a single row)</p>
  
  <pre><code>#!/bin/bash
  for file in pmb_mpi tau xhpl mpi_tile_io fftw ; do
      for f in 2.54 1.60 800 ;do
      if [ ${f} = 2.54 ]
      then 
          for order in even odd ; do
  #       echo ${file}_${f}_${order}_v1.xls &gt;&gt; P-state-summary.xls
          awk '{sum+=$2} END {print ${file}_${f}_${order}_v1.xls, sum/NR}' ${file}_${f}_${order}_v1.xls &gt;&gt; P-state-summary.xls
          done
      else
  #       echo ${file}_${f}_v1.xls &gt;&gt;  P-state-summary.xls
          awk '{sum+=$2} END {print  ${file}_${f}_v1.xls , sum/NR}' ${file}_${f}_v1.xls &gt;&gt;  P-state-summary.xls
      fi
      done
  done
  </code></pre>
  
  <p>Colud anyone of you kindly help me with this ?</p>