From: Will Mernagh (will.mernagh at domain comnitel.com)
Date: Mon 13 Aug 2001 - 16:11:30 IST
Hi,
I have the following in a script
DAYa=`date | awk '{print $3}'`
DAYb=`expr $DAYa - 1`
MONTH=`date '+%m'`
YEAR=`date | awk '{print $6}'`
DATEa=$DAYa'-'$MONTH'-'$YEAR
DATEb=$DAYb'-'$MONTH'-'$YEAR
This returns the following for DATEa 13-08-2001
DATEb 12-08-2001
How can I change the month from 08 to 8. I was thinking of using ${MONTH/0/}
which would do the trick but if the MONTH is 10, 20, 30 etc. I will get 1,
2, 3 etc. So any ideas? and before all of you replying saying the month
can't be 20 or 30, I know but I have the same problem for $DAYa so there.
Regards
__________________________
Will Mernagh
Product Deployment Engineer
Comnitel Technologies
will.mernagh at domain comnitel.com
00 353 21 7306068
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:11:35 GMT