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: Out of topic -Unx question

RE: Out of topic -Unx question

From: david hill <david.hill_at_lechateau.ca>
Date: Mon, 23 Dec 2002 13:49:02 -0800
Message-ID: <F001.0052179A.20021223134902@fatcity.com>


The cheap easy way
Is to have a cron job that runs at midnight and echo's today's date to a file called today.date
But before that it copies that file to yesterday.date Then all you have to do is cat yesterday.date to get the date. It may not be the prettiest way but it works.

-----Original Message-----
Sent: Monday, December 23, 2002 1:04 AM
To: Multiple recipients of list ORACLE-L

Search the archive of this list. This has been discussed before.

You can use a trick such as this:

yesterday=$(TZ=EST26EDT date +%a)

but beaware that this is not a portable solution. You can write your own script. E-mail me off line and I can send you mine yesterday script.

-----Original Message-----
Sent: Monday, December 23, 2002 12:09 AM To: Multiple recipients of list ORACLE-L

Not easily done in Unix. However, if you've got an Oracle db running on the same server you might want to get yesterday's date from Oracle (within a shell script).

...
...
YESTERDAY=`sqlplus -s / <<-EOF

           set head off feed off pages 0
           select trunc(sysdate - 1) from dual;
           exit
           EOF`

echo "YESTERDAY is $YESTERDAY"
...
...

hth,
Ross

-----Original Message-----
Sent: Saturday, 21 December 2002 7:51
To: Multiple recipients of list ORACLE-L

Hi All,

          I want to get previous date from today's date.Is there any cmd for

this.

Thanks
Manoj

--

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

Author:
  INET: manoj.gurnani_at_orbitech.co.in

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).
--

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

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).
--

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

Author: Richard Ji
  INET: richard.ji_at_mobilespring.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).

--

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

Author: david hill
  INET: david.hill_at_lechateau.ca

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 Mon Dec 23 2002 - 15:49:02 CST

Original text of this message

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