Add 1 year to System date in script

Hi All,

I wanted to add 1 year to the system date in my script.

say export start_date=`date +%F`
echo $start_date
o/p of this is 2009-09-02

To this i want to add 1 year.
the output i need here is 2010-09-02

can anybody help me ?

Thanks in advance,
Vinay

One "stupid" way to do that :

export start_date=$(echo $(echo `date +%Y` + 1 | bc)-$(date +%m)-$(date +%d))

There must be a smarter solution ^^

man date like always :wink:
On FreeBSD I use

# date -v +1y +%F
2010-09-02

well...since years don't have awkward diferent lengths like months you could do:

date +%F | awk  '{FS=OFS="-";$1++;print}'
2010-09-02

My awk don't like Tytalus solution

date +%F | awk  'BEGIN{FS=OFS="-"}{$1++}1'
2010-09-02