title: External variable in awk
body: <p>I have a script, in which a script snippet is:</p>
  
  <pre><code>x=3
  awk '$2=$x{print $1}' infile
  </code></pre>
  
  <p>The external variable is <code>x</code>,</p>
  
  <p>but it prompts an error in <code>awk</code></p>
  
  <p>So in this situation, how to make <code>awk</code> run successfully?</p>