title: bash variable as awk field width
body: <p>I have a variable: <code>n=$maxlen</code>, is there any way I can use that as the field width when using printf in awk?</p>
  
  <p>Something like this:</p>
  
  <pre><code>n=$maxlen
  awk -v val=$n -F',' '{printf "%vals %7s %17s %4i\n", $1, $2, $3, $4}' somefile.txt
  </code></pre>