title: grep/awk specific lines based on specific fields; using ksh variable with awk
body: <p>I have this input file: <strong>file_in.txt</strong> (delimited by pipe)</p>
  
  <pre><code>3345:tyg|rty|27|0|0|ty6|{89|io|}62|0
  3346:tyg|rtyuio|63|0|1|ty6|{89|gh|}45|0
  3347:tyu|ray|24|0|0|ty6|{89|uh|}27|0
  3348:tyg|rtoy|93|0|1|ty6|{89|yh|}1|0
  3349:tyo|rtert|28|0|0|ty6|{89|gh|}27|0
  </code></pre>
  
  <p>I want to get only those lines which have 9th field value as <code>}27</code> using <code>'|'</code> as delimiter so that my output should be:</p>
  
  <pre><code>3347:tyu|ray|24|0|0|ty6|{89|uh|}27|0
  3349:tyo|rtert|28|0|0|ty6|{89|gh|}27|0
  </code></pre>
  
  <p>Below command works fine:</p>
  
  <pre><code>awk -F"|" '{ if ($9 == "}27") print $0 }' file_in.txt
  </code></pre>
  
  <p>But I want to use a shell variable instead of <code>"}27"</code> for which I tried this:</p>
  
  <pre><code>taskid="}27"    
  awk -v tid="$taskid" -F"|" '{ if ($9 == "}tid") print $0 }' file_in.txt
  </code></pre>
  
  <p>Please help me figure out where I am going wrong with this command.
  Any other command suggestions to achieve the same are appreciated.</p>