dickiebird
Programmer
Hi Experts
I have a script which I edit each month,
which compresses and moves 2-month-old files
(sample file names are filea.APR.2002 )
eg
MON=APR
YR=2002
compress filea.${MON}.${YR}
mv filea.${MON}.${YR}.Z /archive_dir
I'd prefer not to edit the script each month, but get
the date changed appropriately.
(I can easily set $YR to previous year when current
month is Jan or Feb, just as I can set current month
short name to uppercase :
MON=`date +%b|awk '{printf("%s\n", toupper($0))}'`
But how d'you get $MON from 2 months ago as short
3 char uppercase name ??
Thanks in advance
;-) Dickie Bird
db@dickiebird.freeserve.co.uk
I have a script which I edit each month,
which compresses and moves 2-month-old files
(sample file names are filea.APR.2002 )
eg
MON=APR
YR=2002
compress filea.${MON}.${YR}
mv filea.${MON}.${YR}.Z /archive_dir
I'd prefer not to edit the script each month, but get
the date changed appropriately.
(I can easily set $YR to previous year when current
month is Jan or Feb, just as I can set current month
short name to uppercase :
MON=`date +%b|awk '{printf("%s\n", toupper($0))}'`
But how d'you get $MON from 2 months ago as short
3 char uppercase name ??
Thanks in advance
;-) Dickie Bird
db@dickiebird.freeserve.co.uk