title: Set variable in current shell from awk
body: <p>Is there a way to set a variable in my current shell from within <code>awk</code>?</p>
  
  <p>I'd like to do some processing on a file and print out some data; since I'll read the whole file through, I'd like to save the number of lines -- in this case, <code>FNR</code>.</p>
  
  <p>Happens though I can't seem to find a way to set a shell variable with <code>FNR</code> value; if not this, I'd have to read the <code>FNR</code> from my output file, to set, say <code>num_lines</code>, with <code>FNR</code> value.</p>
  
  <p>I've tried some combinations using <code>awk 'END{system(...)}'</code>, but could not manage it to work. Any way around this? </p>