Hi,
I did a man date on my solaris 9 box and it says
FSF Last change: GNU Shell Utilities
It supports the -d option, but I can't find where it is installed on our server.
/usr/bin/date doesn't support it as you pointed out.
Maybe you can find the GNU shell utilities ( which might complement BASH but weren't installed ) and get them installed on your machine.
Here is a csh script to subtact 5 minutes in %H:%M format.
I do it by adding a day - 5 minutes to avoid the if statements with 00:00 - 00:04 becoming 23:55 - 23:59
#! /bin/csh
set h = `date "+%H"`
set m = `date "+%M"`
@ min = ( $h * 60 ) + $m + 1435
@ h = ( $min / 60 ) % 24
@ m = $min % 60
echo "$h $m" | awk '{printf("%2d:%2d\n",$1,$2)'};
I used awk to make sure I could get 2 DIGIT numbers in the display
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.