Hi folks:
Apologies in advance if this has already been answered :-) - I am unable to view the posting contents in this forum so cannot determine if this has been queried and answered earlier.
In ksh, given a date value, how do I find the corresponding date "x" number of days in the future?
I hope the question is clear with the following example:
###################################
#!/bin/ksh
dd=`/usr/bin/date +%d`
mm=`/usr/bin/date +%m`
YYYY=`/usr/bin/date +%Y`
currentDate=$YYYY-$mm-$dd
echo "Current date is $currentDate"
#In the below code, x is a variable
#it will be 90 in most cases
#I need to add x to the currentDate
# and store it in the variable futureDate
futureDate=$currentDate+$x
echo "Future date is $futureDate"
###################################
Appreciate a response.
Thanks