Ross:
Actually, this solves the problem nicely. I can always find an oracle database up around here somewhere :)
A couple of folks suggested this approach and I was going to work on it yesterday when chaos broke out. But you were kind enough to give me the code!
It's very much appreciated.
Thanks!
Run your script at 23:58 :-)
Yechiel AdarMehish
- Original Message -
From:
Barbara
Baker
To: Multiple recipients of list ORACLE-L
Sent: Wednesday, November 13, 2002 8:24
PM
Subject: OT ksh day of week
yesterday
Will someone take pity on this poor VMS'er
yesterday=$(TZ=EST26EDT date +%a)
On Wed, 13 Nov 2002, Barbara Baker wrote:
Will someone take pity on this poor VMS'er lost in a unix world??
I'm trying to create a script (ksh) that reads a log file created yesterday. The
log files are created with `date +%a` appended to the end of the
My TZ is EST5EDT and I think the 5 implies GMT-05:00
What does the 26 in EST26EDT imply?
Just curious.
Ed
-Original Message-
Sent: Wednesday, November 13, 2002 2:24 PM
To: Multiple recipients of list ORACLE-L
yesterday=$(TZ=EST26EDT date +%a)
On Wed, 13 Nov 2002, Barbara Baker wrote:
Barbara Baker wrote:
Will someone take pity on this poor VMS'er lost in a unix world??
I'm trying to create a script (ksh) that reads a log file created
yesterday. The log files are created with `date +%a` appended to the
end of the log file name. Last night a log file was created called
same thing. time offset. This may not work on all systems because of how
TZ is used.
On Wed, 13 Nov 2002, Sherman, Edward wrote:
My TZ is EST5EDT and I think the 5 implies GMT-05:00
What does the 26 in EST26EDT imply?
Just curious.
Ed
-Original Message-
Sent: Wednesday, November
Barb,
Try this:
#!/bin/ksh
#
# set up arrys of day strings, offset by one from real day
#
set -A days Fri Sat Sun Mon Tues Wed Thurs
#
# determine today's day of week index
#
index=$(date '+%u')
#
# Use index to get previous days abbreviation
#
echo ${days[$index]}
#
grep STRING
Thanks, everyone, for your suggestions.
Alex's solution looks like it will fix beautifully. George's script looks great -- and I can think of another application where it's going to come in handy.
Thanks again!
Charlie: I'm impressed. I didn't start working with VMS until version 3...
Barb
Alex
This is an offset of 26 hours. But from what I understand
this solution has a problem since some systems don't accept
offsets over 24 hours and if timezone is west of GMT then
you can't set the offset far enough for it to work. In another
words, it's not a portable solution.
-Original
I used to have this requirement too. I never got to solve it by just using
ksh scripting so ended up getting Oracle to derive the value for me. I guess
this doesn't solve your problem if you don't have an Oracle db running.
#!/bin/ksh
YESTERDAY=`sqlplus -s / -EOF
set head off feed
10 matches
Mail list logo