I am new to scripting I needed a script in the AIX environment to get the next days date based on the date entered by the user of the script.
After hard time browsing for this I got a piece of code which does the reverse of the goal which i had to achieve. It gets me one day before(Yesterday's) the date entered by the user.
The code is as below
#!/bin/ksh echo "Enter the date (YYYY/MM/DD):" read date YEAR=`echo $date | cut -d"/" -f1` MONTH=`echo $date | cut -d"/" -f2` DAY=`echo $date | cut -d"/" -f3` DAY=`expr "$DAY" - 1` case "$DAY" in 0) MONTH=`expr "$MONTH" - 1` case "$MONTH" in 0) MONTH=12 YEAR=`expr "$YEAR" - 1` ;; esac DAY=`cal $MONTH $YEAR | grep . | fmt -1 | tail -1` esac echo "Yesterday's Date is $YEAR/$MONTH/$DAY"
Can some one please help to me acheive this. That is to get the next day of the user entered date.
Enter the date (YYYY/MM/DD): 2013/09/30 Tomorrow's Date is 2013/10/1