title: converting 4 digit year to 2 digit in shell script
body: <p>I have file as:</p>
  <pre><code>$cat file.txt
  1981080512 14 15
  2019050612 17 18
  2020040912 19 95
  </code></pre>
  <p>Here the 1st column represents dates as YYYYMMDDHH</p>
  <p>I would like to write the dates as YYMMDDHH. So the desire output is:</p>
  <pre><code>81080512 14 15
  19050612 17 18
  20040912 19 95
  </code></pre>
  <p>My script:</p>
  <pre><code>while read -r x;do
  yy=$(echo $x | awk '{print substr($0,3,2)}')
  mm=$(echo $x | awk '{print substr($0,5,2)}')
  dd=$(echo $x | awk '{print substr($0,7,2)}')
  hh=$(echo $x | awk '{print substr($0,9,2)}')
  
  awk '{printf &quot;%10s%4s%4s\n&quot;,'$yy$mm$dd$hh',$2,$3}'
  done &lt; file.txt
  </code></pre>
  <p>It is printing</p>
  <pre><code>81080512   14  15
  81080512   17  18
  </code></pre>
  <p>Any help please. Thank you.</p>