This is driving me nuts. I am trying to write an AIX script to list files created last month. When I get the command working, i'm going to change the "ls -l" to a "rm" command. The code that subtracts 1 from pdate is giving me an error. How do I either subtract 1 from a field? Or how do I ask for the date in a ccyymm-1 format? What I want the script to give me is 200404 in the pdate field, not 200405. Thanks, any help would be greatly appreciated.
echo
. /home/db2inst1/.profile
pdate= date '+%Y%m'
pdate= $pdate - 1
$pdate >> cmsdevprune.rpt
ls -l /cmsbackt/COMMCMSD.0.cmsdev.NODE0000.CATN0000.${pdate}*.* >> cmsdevprune.rpt