Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

date

0 views
Skip to first unread message

Scott

unread,
Nov 1, 2001, 12:06:18 PM11/1/01
to
Does anyone know how to find tomorrow's date in SCO OSR5.0.5?
Must be leap year compliant.

TIA

Scott

Tony Lawrence

unread,
Nov 1, 2001, 12:41:13 PM11/1/01
to
Scott wrote:
>
> Does anyone know how to find tomorrow's date in SCO OSR5.0.5?
> Must be leap year compliant.

datemath.tgz is available from ftp://ftp.jpr.com , that gives you the
ability to do (for example):
datecalc + 1
and get tomorrow's date. There are shell and awk scripts for various
date related tasks.

http://pcunix.com/Unix/yesterday.html is the opposite of what you want
(it finds out when yesterday was), but the same concept can be adapted
to forward dates.

It's all a lot easier with Perl,

--
Tony Lawrence
SCO/Linux Support Tips, How-To's, Tests and more: http://pcunix.com

Jean-Pierre Radley

unread,
Nov 1, 2001, 12:44:43 PM11/1/01
to ScoMisc [c.u.s.m]
Scott propounded (on Thu, Nov 01, 2001 at 09:06:18AM -0800):

| Does anyone know how to find tomorrow's date in SCO OSR5.0.5?
| Must be leap year compliant.

Pick up Bob Stockler's datemath.tgz file from ftp.jpr.com.

--
JP

Scott

unread,
Nov 1, 2001, 1:17:45 PM11/1/01
to
Tony Lawrence wrote:
>
> Scott wrote:
> >
> > Does anyone know how to find tomorrow's date in SCO OSR5.0.5?
> > Must be leap year compliant.
>
> datemath.tgz is available from ftp://ftp.jpr.com , that gives you the
> ability to do (for example):
> datecalc + 1
> and get tomorrow's date. There are shell and awk scripts for various
> date related tasks.

That's a load of useful scripts. Thanks JP


>
> http://pcunix.com/Unix/yesterday.html is the opposite of what you want
> (it finds out when yesterday was), but the same concept can be adapted
> to forward dates.

That's very useful too. I can adapt.

> It's all a lot easier with Perl,

Yes, it would be a one liner with Perl. :)

Thanks for all your help.

Brian K. White

unread,
Nov 1, 2001, 3:29:11 PM11/1/01
to

----- Original Message -----
From: "Scott" <skot...@yahoo.com>
Newsgroups: comp.unix.sco.misc
Sent: Thursday, November 01, 2001 12:06 PM
Subject: date


> Does anyone know how to find tomorrow's date in SCO OSR5.0.5?
> Must be leap year compliant.
>

> TIA
>
> Scott

gnu date supports syntax like this, I use it for archiving log files by
date, makes it easy to split out everything older than 45 days for instance.

combined with "+%xxx" formatting strings and you can do some nice easy
splitting and grouping using simple math comparisons.


mkdir /vols
cd /vols
ftp ftp2.caldera.com
cd /pub/skunkware/osr5/shellutil/sh-utils
get sh-utils-2.0-VOLS.tar
quit
tar xvf *.tar
rm *.tar
custom
software
install new
from localhost
media images
/vols
install
ok
host
exit


[root@aljex /vols] /usr/local/bin/date
Thu Nov 1 13:41:39 EST 2001
[root@aljex /vols] /usr/local/bin/date --d "1 day"
Fri Nov 2 13:41:43 EST 2001
[root@aljex /vols] /usr/local/bin/date --d "1 day ago"
Wed Oct 31 13:41:46 EST 2001
[root@aljex /vols]

enjoy :)

here's a couple ways I use it...

I combine this with a feature of gnu tar to use bzip2 compression internally
and another feature of gnu tar to "mv" the files into the archive, so I have
a single line of code that does a lot of things at once
# once every morning, take all of a certain group of files and archive them
# and give it a filename with yesterdays day of the week name
# this keeps a constant 7 day history of these text files which get created
and
# uploaded somewhere every 15 minutes throughout the day.
gtar cIf DAT_out_`date -d "1 day ago" +%a`.tar.bz2 --remove-files
${DATUSER}*.txt


# this part of a vsi-fax databes maintenance script I wrote that
# purges all records older than 45 days from the live database
# but keeps them archived in bzip2 compressed csv files
# runs every night. so every night it trims off one days worth of data
# from 45 days ago.

# keep DAYS number of days from cmd line , or default 45
typeset -i DAYS=${1:-45}
# date DAYS days ago in format that matches vsi-fax
CUT=`date -d "${DAYS} days ago" +%Y%m%d%H%M%S`
# get a fax sequence number from the cutoff date
typeset -i SEQ=`vdbtool unload -t "eti>${CUT}" -f seq -F pipe ${DBS}/faxreqs
|sort -n |sed -n 1p`
[...]
# export all records with sequence number below cutoff
vdbtool unload -t "seq<${SEQ}" ${DBS}/${DB} |bzip2 >${DB}-${CUT}.csv.bz2
[...]
# purge the old records from the live database
vfxpurge -o ${DAYS}
[...]

Brian K. White -- br...@aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani

Scott

unread,
Nov 1, 2001, 4:02:43 PM11/1/01
to
"Brian K. White" wrote:
>
> ----- Original Message -----
> From: "Scott" <skot...@yahoo.com>
> Newsgroups: comp.unix.sco.misc
> Sent: Thursday, November 01, 2001 12:06 PM
> Subject: date
>
> > Does anyone know how to find tomorrow's date in SCO OSR5.0.5?
> > Must be leap year compliant.
> >
> > TIA
> >
> > Scott
>
> gnu date supports syntax like this, I use it for archiving log files by
> date, makes it easy to split out everything older than 45 days for instance.
>
<snip>

> [root@aljex /vols] /usr/local/bin/date --d "1 day"
> Fri Nov 2 13:41:43 EST 2001
> [root@aljex /vols] /usr/local/bin/date --d "1 day ago"
> Wed Oct 31 13:41:46 EST 2001
> [root@aljex /vols]
>

Kewl, just like the one on my Linux boxen. :)

Brian K. White

unread,
Nov 1, 2001, 4:40:03 PM11/1/01
to

"Scott" <skot...@yahoo.com> wrote in message
news:3BE1B873...@yahoo.com...


looks like i fudged the syntax a little, I did test all this on my own sco
box as I posted it. But I really ran:
.../date --date "..."

then while looking at my scripts I noticed in them I have:
.../date -d "..."

so I went back and edited the lines I pasted from my terminal so they too
would say:
-d "..."
because it's shorter, but as you can see above I did a half vast job of it.


--

Scott

unread,
Nov 1, 2001, 4:55:53 PM11/1/01
to

heh, nothing a little "man" hunt wouldn't fix. ;)

0 new messages