Hi,
I'm working in HP-ux 11 and I'm trying to get yesterdays date into a variable that I can use later on in a script.
I use the format:
DATE=`date '+%d-%b-%Y'`
which gives me i.e. 01-Jan-2007
I make it uppercase and gets it into a variable with
export Y_DATE=$(printf "%s\n" "$DATE" | tr '[a-z]' '[A-Z]')
which gives me 01-JAN-2007 as value in Y_DATE
The question is how can I get the result to be 31-DEC-2006 in Y_DATE??
Thankfull for any help
Start Free Trial