08-28-2001
Except if you run it on the 1st, then 1-2 = -1. Oops.
A portable solution is to convert the current date to a julian value, subtract 2 and then convert back to a gregorian value. A script to convert to/from julian date is here:
http://droflet.net/julian.txt
Last edited by PxT; 08-28-2001 at 03:49 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
How can i change date value to date value - 1 in unix ?
I mean sysdate to sysdate -1.
Can anyone throw some light on that ?
cheers,
gopskrish (2 Replies)
Discussion started by: gopskrish
2 Replies
2. UNIX for Dummies Questions & Answers
Dear
I check script written in Unix commands and i face misunderstanding in date format.
the format is ( sysdate -p -f%d/%m/%Y ). can you told me what is ( -p and
-f ) means. and can you write sample for this. (1 Reply)
Discussion started by: abu_hassan
1 Replies
3. UNIX for Dummies Questions & Answers
I need to automate the creation of a file. It needs to have the date of the previous day. In sqlplus we use sysdate -1 but I checked the man page for date and didn't find a similar command. This is what I use for creating a file for the current date:
rciind`date '+%m%d%Y'`.txt
What do I... (1 Reply)
Discussion started by: kskywr
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
There is file on UNIX server named as fd40568-07082009.txt which get FTP'ed to UNIX on a daily basis. 07082009 of fd40568-07082009.txt represents the system date. This type of .txt gets FTP on a daily basis.
My requirement is to rename the fd40568-07082009.txt to fd40568-07072009.txt... (2 Replies)
Discussion started by: rahulbahulekar
2 Replies
5. Shell Programming and Scripting
Hi,
I need to append the current system date and time in my file which are being taken a backup by my shell script .so i added the following line in by .profile
SYSDATE="$( date '+%d/%B/%Y/%S' )"
export SYSDATE
But it's a constant one rather then a sync with my system date ,so how can i do... (10 Replies)
Discussion started by: malickhat
10 Replies
6. Shell Programming and Scripting
I am use unix shell script to called an sql Script to query data in my shell program.
sqlplus -S /nolog @update.sql
but my script on function "sysdate" not work !!
Could you tel me,How can i use function "sysdate" on unix or can replace the other function in my script to get data in system... (5 Replies)
Discussion started by: krai
5 Replies
7. Shell Programming and Scripting
Hi Guys,
I wanted to create an Unix Shell Script that should fetch a particular string from a text file on a particular date.
We all know Oracle generates alert logs for each and every day for every actions in the database.
I have an alert log file now where it contains for about a months... (4 Replies)
Discussion started by: raja_dba
4 Replies
8. UNIX for Dummies Questions & Answers
How do i insert the sysdate in the below xml file? This has to happen dynamically, meaning everytime the script runs, it shud put 2 sysdates in the below xml marked in red ...format is YYYY-MM-DD
<?xml version="1.0" encoding="UTF-8"?>
<Package>
<LOCALE>en_US</LOCALE>
<User... (2 Replies)
Discussion started by: saggiboy10
2 Replies
9. Shell Programming and Scripting
Looking for help.
I need help in the grep ( alternative) to filter out the a keyword from the logfile for a time period of sysdate -1.
My logfile looks like:
####<Sep 7, 2014 3:46:55 PM PDT> <Warning> <Management> <hostname> <> < ExecuteThread:
####<Sep 15, 2014 2:51:05 AM PDT>... (1 Reply)
Discussion started by: jjoy
1 Replies
10. Shell Programming and Scripting
I have a file from which I need to filter out certain lines when field 17 is less than sysdate. The file has date in YYYYMMDD HH:MI:SS format.
Sample file is as below:
PRUM,67016800 ,CC ,C1,67016800 ,00,Y,Y,2 ,US,BX,BOX ... (5 Replies)
Discussion started by: mady135
5 Replies
LEARN ABOUT DEBIAN
mojo::url
Mojo::URL(3pm) User Contributed Perl Documentation Mojo::URL(3pm)
NAME
Mojo::URL - Uniform Resource Locator
SYNOPSIS
use Mojo::URL;
# Parse
my $url
= Mojo::URL->new('http://sri:foobar@kraih.com:3000/foo/bar?foo=bar#23');
say $url->scheme;
say $url->userinfo;
say $url->host;
say $url->port;
say $url->path;
say $url->query;
say $url->fragment;
# Build
my $url = Mojo::URL->new;
$url->scheme('http');
$url->userinfo('sri:foobar');
$url->host('kraih.com');
$url->port(3000);
$url->path('/foo/bar');
$url->path('baz');
$url->query->param(foo => 'bar');
$url->fragment(23);
say $url;
DESCRIPTION
Mojo::URL implements a subset of RFC 3986 and RFC 3987 for Uniform Resource Locators with support for IDNA and IRIs.
ATTRIBUTES
Mojo::URL implements the following attributes.
"authority"
my $authority = $url->authority;
$url = $url->authority('root:pass%3Bw0rd@localhost:8080');
Authority part of this URL.
"base"
my $base = $url->base;
$url = $url->base(Mojo::URL->new);
Base of this URL.
"fragment"
my $fragment = $url->fragment;
$url = $url->fragment('foo');
Fragment part of this URL.
"host"
my $host = $url->host;
$url = $url->host('127.0.0.1');
Host part of this URL.
"port"
my $port = $url->port;
$url = $url->port(8080);
Port part of this URL.
"scheme"
my $scheme = $url->scheme;
$url = $url->scheme('http');
Scheme part of this URL.
"userinfo"
my $userinfo = $url->userinfo;
$url = $url->userinfo('root:pass%3Bw0rd');
Userinfo part of this URL.
METHODS
Mojo::URL inherits all methods from Mojo::Base and implements the following new ones.
"new"
my $url = Mojo::URL->new;
my $url = Mojo::URL->new('http://127.0.0.1:3000/foo?f=b&baz=2#foo');
Construct a new Mojo::URL object.
"clone"
my $url2 = $url->clone;
Clone this URL.
"ihost"
my $ihost = $url->ihost;
$url = $url->ihost('xn--bcher-kva.ch');
Host part of this URL in punycode format.
# "xn--da5b0n.net"
Mojo::URL->new('http://X.net')->ihost;
"is_abs"
my $success = $url->is_abs;
Check if URL is absolute.
"parse"
$url = $url->parse('http://127.0.0.1:3000/foo/bar?fo=o&baz=23#foo');
Parse URL.
"path"
my $path = $url->path;
$url = $url->path('/foo/bar');
$url = $url->path('foo/bar');
$url = $url->path(Mojo::Path->new);
Path part of this URL, relative paths will be appended to the existing path, defaults to a Mojo::Path object.
# "http://mojolicio.us/DOM/HTML"
Mojo::URL->new('http://mojolicio.us/perldoc/Mojo')->path('/DOM/HTML');
# "http://mojolicio.us/perldoc/DOM/HTML"
Mojo::URL->new('http://mojolicio.us/perldoc/Mojo')->path('DOM/HTML');
# "http://mojolicio.us/perldoc/Mojo/DOM/HTML"
Mojo::URL->new('http://mojolicio.us/perldoc/Mojo/')->path('DOM/HTML');
"query"
my $query = $url->query;
$url = $url->query(replace => 'with');
$url = $url->query([merge => 'with']);
$url = $url->query({append => 'to'});
$url = $url->query(Mojo::Parameters->new);
Query part of this URL, defaults to a Mojo::Parameters object.
# "2"
Mojo::URL->new('http://mojolicio.us?a=1&b=2')->query->param('b');
# "http://mojolicio.us?a=2&c=3"
Mojo::URL->new('http://mojolicio.us?a=1&b=2')->query(a => 2, c => 3);
# "http://mojolicio.us?a=2&b=2&c=3"
Mojo::URL->new('http://mojolicio.us?a=1&b=2')->query([a => 2, c => 3]);
# "http://mojolicio.us?b=2"
Mojo::URL->new('http://mojolicio.us?a=1&b=2')->query([a => undef]);
# "http://mojolicio.us?a=1&b=2&a=2&c=3"
Mojo::URL->new('http://mojolicio.us?a=1&b=2')->query({a => 2, c => 3});
"to_abs"
my $abs = $url->to_abs;
my $abs = $url->to_abs(Mojo::URL->new('http://kraih.com/foo'));
Clone relative URL and turn it into an absolute one.
"to_rel"
my $rel = $url->to_rel;
my $rel = $url->to_rel(Mojo::URL->new('http://kraih.com/foo'));
Clone absolute URL and turn it into a relative one.
"to_string"
my $string = $url->to_string;
Turn URL into a string.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo::URL(3pm)