title: Unix shell - syntax error near unexpected token `done'
body: <p>Below is my code.</p>
  
  <pre><code>#!/bin/ksh
  curdate=$(date '+%d%h,%Y')
  while read line;
  do
    echo "$line" &gt; new10.txt
    str0=$(cut -f 2 new10.txt)
    str01=$(cut -f 1 -d ',' new10.txt)
    str1=$(cut -f 2 -d ',' new10.txt)
    str2=$(cut -c 3 $str1)
    if [ $str2=':' ];
    then
      str2=',2016'
      finalstr=$str01$str2
      if [ '01jan2017' -le $finalstr -le $curdate ];
      then
        finalstr1=$str01',2017'
      else
        finalstr1=$str01',2016'
        echo $finalstr1 &gt; datefinal.txt
      fi
  done &lt; /export/home/islams/PISAS/userwiseutil/date.txt
  </code></pre>
  
  <p>I am getting following errors:
  date1.sh: line 22: syntax error near unexpected token <code>done'
  date1.sh: line 22:</code>done &lt; /export/home/islams/PISAS/userwiseutil/date.txt'</p>