Quote:
Originally Posted by ali560045
i have a script called date_add.sh written in k_shell
My shell script requirement is that it accepts a date from the user in the format YYYY-MM-DD and then it shows all the 15 days later day availaible in the current year
if date accepted from user is 2008-10-13,then the o/p sholud be
2008-10-28
2008-11-12
2008-11-27
2008-12-12
2008-12-27
-----------------------------------------------------------------------
|
Code:
. date-funcs
year=$( date +%Y )
_DATESHIFT=$1
while :
do
_dateshift $_DATESHIFT 15
[ ${_DATESHIFT%%-*} -ne $year ] && break
printf "%s\n" "$_DATESHIFT"
done