title: AWK command for *
body: <p>I am trying to retrieve the fourth column of a text using awk with a criteria on the 2nd row of a file, however I am getting a blank value as output. </p>
  
  <p>Here is my Input file contents
  1st line : <code>xxxx</code>
  2nd line : <code>GS*HP*IRX*029053964*20180611*114500</code></p>
  
  <p>I need to look for the criteria <code>HP*IRX*</code> in the input file and print the value <code>20180611</code> ( 4th column)</p>
  
  <p>Here is my script </p>
  
  <pre><code>filedate=$(awk -F "*" '/HP*IRX/{print $4}' $file)
    echo $filedate
  </code></pre>
  
  <p>Pls advise what I am missing.. tnx!</p>