retrieve Yesterday date (or before) on Solaris
As we know Solaris date is not GNU date. To get yesterday date in solaris you have to do it manually instead of simply using option -d.
#!/usr/bin/sh
TZ="WIB+17"
export TZ
yestd=`date +%Y-%m-%d`
echo $yestd
unset TZ
TZ="WIB+41"
export TZ
yestd1=`date +%Y-%m-%d`
echo $yestd1
unset TZ
today=`date +%Y-%m-%d`
echo $today
Above script is on Bourne Shell (sh), please adjust accordingly if you are on other shell (csh or bash).
in csh or bash AFAIK, use setenv instead of export.










