Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: OT ksh day of week yesterday

RE: OT ksh day of week yesterday

From: Barbara Baker <barbarabbaker_at_yahoo.com>
Date: Thu, 14 Nov 2002 07:03:28 -0800
Message-ID: <F001.0050341B.20021114070328@fatcity.com>

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!
Barb
 Ross Collado <Ross.Collado_at_techpac.com> wrote: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 off pages 0
select to_char(sysdate-1,'fmDy') from dual; exit
EOF`
TODAY=`date +\%a`
echo "TODAY is $TODAY YESTERDAY is $YESTERDAY"

Hth,
Ross

-----Original Message-----
Sent: Thursday, 14 November 2002 5:25
To: Multiple recipients of list ORACLE-L

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 arc_indexlog.Tue It's easy enough to get today

TDAY="`date +%a`"
grep -i "ora" /orasrv/ops/maint/logs/arc_indexlog.$TDAY grep -i "ora" /orasrv/ops/maint/logs/adv_indexlog.$TDAY

but how do I get yesterday in the same format? (i.e., Tue instead of Wed) I man'd date, but it was no help.

Thanks for any help.

Barb


Do you Yahoo!?
U2 on
LAUNCH - Exclusive medley & videos from Greatest Hits CD

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Ross Collado
INET: Ross.Collado_at_techpac.com

Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services



To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Barbara Baker
  INET: barbarabbaker_at_yahoo.com
Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Nov 14 2002 - 09:03:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US