title: awk command to convert date format in a file
body: <p>Given below is the file content and the awk command used:</p>
  
  <p><strong>Input file:in_t.txt</strong></p>
  
  <pre><code>1,ABC,SSS,20-OCT-16,4,1,0,5,0,0,0,0
  2,DEF,AAA,20-JUL-16,4,1,0,5,0,0,0,0
  </code></pre>
  
  <p><strong>Expected outfile:</strong></p>
  
  <pre><code>SSS|2016-10-20,5
  AAA|2016-07-20,5
  </code></pre>
  
  <p>I tried the below command:</p>
  
  <pre><code>awk -F , '{print $3"|"$(date -d 4)","$8}' in_t.txt
  </code></pre>
  
  <p><strong>Got the outfile as:</strong></p>
  
  <pre><code>SSS|20-OCT-16,5
  AAA|20-JUL-16,5
  </code></pre>
  
  <p>Only thing I want to know is on how to format the date with the same awk command. Tried with </p>
  
  <pre><code>awk -F , '{print $3"|"$(date -d 4)","$8 +%Y-%m-%d}' in_t.txt
  </code></pre>
  
  <p>Getting syntax error. Can I please get some help on this?</p>