Title: RE: Out of topic -Unx question
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
my unix sysadmin was kind enough to give me following few monts ago. Works
great and can be used for creating any date in dd-mon-yy format
DAY=`perl -e 'use POSIX qw(strftime); print strftime(%d-%b-%y,
localtime(time() - 86400)) . \n ;'`
HTH
Shaleen
- Original Message -
To: Multiple
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;
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
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: [EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego,