07-03-07 06:22 PM
On Jul 2, 10:24 am, "Banzai" <ban...@aaa.com> wrote:
> Hello
>
> The implementation of date in linux has a -d flag to present yesterdays
> date.
>
> For instance
>
> # date +"%Y-%m-%d"
> 2007-07-02
> # date +"%Y-%m-%d" -d yesterday
> 2007-07-01
>
> Is there something similar for tru64 ?? as it doesn't seem to support the
-d
> flag
Try this:
#!/bin/ksh -vx
localtime=$(date +%H)
utc=$(date -u +%H)
offset=$(($utc - $localtime))
today=$(TZ="EST${offset}EDT${offset}" date)
offset=$(($offset + 24))
yesterday=$(TZ="EST+${offset}EDT+${offset}" date)
[ Post a follow-up to this message ]
|