title: Yesterdays and Next date from given date using ksh on AIX
body: <p>I'm trying to write a script in that need to compute date-1 and date+1 after </p>
  
  <p>reading the Date from variable </p>
  
  <p>echo <code>2017-09-30</code> | read YYYY MM DD</p>
  
  <p>how to print next date as 2017-10-01  trying on AIX OS  .</p>
  
  <p>This is  the piece of code from it </p>
  
  <pre><code>date ()
  {
     DAY=$D1
     TODAY=$D1
     DAY1=$D1
     echo $DAY1| read YYYY MM DD
     let DD=DD+1
     DD=`printf %02d $DD`
     if [[ $DD -eq 0 ]] then
     let MM=MM-1
     MM=`printf %02d $MM`
     if [[ $MM -eq 0 ]] then
     let YYYY=YYYY-1
     let MM=12
     let DD=31
     fi
     DD=`cal $MM $YYYY|grep . |fmt -1|tail -1`
    fi
    NEXTDAY=`echo $YYYY-$MM-$DD`
    echo $NEXTDAY
    }
  </code></pre>