The date command in AIX doesn't support "-d" switch. So it is not easy to get the date of the days before (or after) today.
After research, I think it is best to use perl to compute the date we want.
Here it is:
#!/usr/bin/env shDAYS=-5DATE=`DAYS=$DAYS perl -MPOSIX -le 'print strftime("%Y%m%d", localtime(time() + $ENV{'DAYS'} *24 *60 *60))'`#echo $DATE