title: How to validate a contents of a file using awk command?
body: <p>I have a file abc.txt with contents as :</p>
  
  <pre><code>8503 C
  8501 C
  8500 C
  </code></pre>
  
  <p>I want to validate the contents of the file in a such a way that:</p>
  
  <p>For <code>8503</code> - the value has to be "C"<br>
  if yes then success<br>
  else Fail</p>
  
  <p>It should repeat for all the contents in the file </p>
  
  <p>ie. suppose if the file contains:</p>
  
  <pre><code>8503 E
  8501 C
  8500 C
  </code></pre>
  
  <p>Now <code>8503</code> has value as "E" then it is a failure.
  8501 has value as "C" it is a success</p>
  
  <p>How would I do it using shell script?</p>
  
  <hr>
  
  <p>I tried the below command : </p>
  
  <pre><code>awk -F ' ' '$2 != "C" { echo "Value is not C for happy path" }' &lt; /tmp/abc.data
  </code></pre>
  
  <p>but it gives me a blank output without the echo being displayed. </p>
  
  <p>I want to see if the second column of the file has any value apart from "C" then it is a failure.</p>
  
  <p>Any input is appreciated.</p>
  
  <p>Thanks,</p>