Sponsored Content
Top Forums Shell Programming and Scripting ksh compare dates INSIDE a file (ie date A is > date B) Post 302561859 by right_coaster on Wednesday 5th of October 2011 11:47:21 AM
Old 10-05-2011
Wow, maybe I need to turn on my brain... it's always the obvious that eludes me! Thank you.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

compare today's date with date in a file

Hi I am very new to scripting, Can someone show me how to (in unix shell script) compare the system's date with a date in a file. The requirement is to somehow open this file (which will only have a date in it) and compare it with today's date. If they are equal execute a procedure below but if... (4 Replies)
Discussion started by: siog
4 Replies

2. Shell Programming and Scripting

Compare dates in a field and print the latest date row

Hi, I need a shell script which should find the latest date in the field of file and print that line only. For eg., I have a file /date.log Name Date Status IBM 06/06/07 close DELL 07/27/07 open DELL 06/07/07 open : : : From... (1 Reply)
Discussion started by: cvkishore
1 Replies

3. Shell Programming and Scripting

change date format and then compare dates

I have filenames filenameA_fg_MMDDYY.tar.gz filenameASPQ_fg_MMDDYY.tar.gz filenameAFTOPHYYINGH_fg_MMDDYY.tar.gz filenameAGHYSW_fg_MMDDYY.tar.gz My requiremnt needs to extract date which is in MMDDYYand change it into YYYYMMDD format. I have done the following: filedate=`echo... (5 Replies)
Discussion started by: RubinPat
5 Replies

4. Shell Programming and Scripting

Generate quarter dates with begin date and end date

Hi All, I am trying to generate quarter dates with user giving input as begin date and end date. Example: Input by user: begin_date = "2009-01-01" end_date = 2010-04-30" required output: 2009-01-01 2009-03-31 09Q01 2009-04-01 2009-06-30 09Q02 . . till 2010-01-01 2010-03-31 10Q01 ... (9 Replies)
Discussion started by: sol_nov
9 Replies

5. UNIX and Linux Applications

sqlite: calculating with dates - compare current date minus 6 months with stored record

Hi I have a table with name, date in format DD.MM.YYYY. I need to something like this (I try to explain in pseudo code) if SYSDATE (current date) minus 6 months > $expiry date print OK else print NOK with $name and $expiry date I know this is possible with Oracle. How to do this... (0 Replies)
Discussion started by: slashdotweenie
0 Replies

6. Shell Programming and Scripting

Need to capture all dates between start date and End date.

Hi All, I enter Start date and end date as parameters. I need to capture dates between start date and end date. Please let me know if you have any idea the same. Thanks in advance. Nagaraja Akkivalli. (5 Replies)
Discussion started by: Nagaraja Akkiva
5 Replies

7. Shell Programming and Scripting

compare date and time inside data of two files

i have two files with identical no of columns. 6th columns is date (MM/DD/YY format) and 7th columns is time (HH:MM:SS) format. I need to compare these two vaules and if the date & time is higher than fileA, save it on fileC; if the value is lower, then save it on fileD CONDITIONS... (7 Replies)
Discussion started by: ajiwww
7 Replies

8. Shell Programming and Scripting

Need to capture dates between start date and end date Using perl.

Hi All, Want to get all dates and Julian week number for that date between the start date and end date. How can I achive this using perl? (To achive above functionality, I was connecting to the database from DB server. Need to execute the same script in application server, since databse... (6 Replies)
Discussion started by: Nagaraja Akkiva
6 Replies

9. Shell Programming and Scripting

Searching for unknown date inside the file and replace to new date

Hello, Iam a newbies to Shell scripting. Iam trying to replace the date inside the file to new date. is there anyway that we can just use the pattern to search as "..." I have many files want to replace with the same date, and each file contains different date. Thanks for your help. ... (2 Replies)
Discussion started by: Daro
2 Replies

10. Shell Programming and Scripting

Compare the system date with date from a text file

I get the date that's inside a text file and assigned it to a variable. When I grep the date from the file, I get this, Not After : Jul 28 14:09:57 2017 GMT So I only crop out the date, with this command echo $dateFile | cut -d ':' -f 2,4The result would be Jul 28 14:57 2017 GMT How do I... (3 Replies)
Discussion started by: Loc
3 Replies
strictures(3pm) 					User Contributed Perl Documentation					   strictures(3pm)

NAME
strictures - turn on strict and make all warnings fatal SYNOPSIS
use strictures 1; is equivalent to use strict; use warnings FATAL => 'all'; except when called from a file where $0 matches: /^x?t/.*.t$/ and when either '.git' or '.svn' is present in the current directory (with the intention of only forcing extra tests on the author side) - or when the PERL_STRICTURES_EXTRA environment variable is set, in which case use strictures 1; is equivalent to use strict; use warnings FATAL => 'all'; no indirect 'fatal'; no multidimensional; no bareword::filehandles; Note that _EXTRA may at some point add even more tests, with only a minor version increase, but any changes to the effect of 'use strictures' in normal mode will involve a major version bump. If any of the extra testing modules are not present, strictures will complain loudly, once, via warn(), and then shut up. But you really should consider installing them, they're all great anti-footgun tools. DESCRIPTION
I've been writing the equivalent of this module at the top of my code for about a year now. I figured it was time to make it shorter. Things like the importer in 'use Moose' don't help me because they turn warnings on but don't make them fatal - which from my point of view is useless because I want an exception to tell me my code isn't warnings clean. Any time I see a warning from my code, that indicates a mistake. Any time my code encounters a mistake, I want a crash - not spew to STDERR and then unknown (and probably undesired) subsequent behaviour. I also want to ensure that obvious coding mistakes, like indirect object syntax (and not so obvious mistakes that cause things to accidentally compile as such) get caught, but not at the cost of an XS dependency and not at the cost of blowing things up on another machine. Therefore, strictures turns on additional checking, but only when it thinks it's running in a test file in a VCS checkout - though if this causes undesired behaviour this can be overridden by setting the PERL_STRICTURES_EXTRA environment variable. If additional useful author side checks come to mind, I'll add them to the _EXTRA code path only - this will result in a minor version increase (i.e. 1.000000 to 1.001000 (1.1.0) or similar). Any fixes only to the mechanism of this code will result in a subversion increas (i.e. 1.000000 to 1.000001 (1.0.1)). If the behaviour of 'use strictures' in normal mode changes in any way, that will constitute a major version increase - and the code already checks when its version is tested to ensure that use strictures 1; will continue to only introduce the current set of strictures even if 2.0 is installed. METHODS
import This method does the setup work described above in "DESCRIPTION" VERSION This method traps the strictures->VERSION(1) call produced by a use line with a version number on it and does the version check. COMMUNITY AND SUPPORT
IRC channel irc.perl.org #toolchain (or bug 'mst' in query on there or freenode) Git repository Gitweb is on http://git.shadowcat.co.uk/ and the clone URL is: git clone git://git.shadowcat.co.uk/p5sagit/strictures.git AUTHOR
mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk> CONTRIBUTORS
None required yet. Maybe this module is perfect (hahahahaha ...). COPYRIGHT
Copyright (c) 2010 the strictures "AUTHOR" and "CONTRIBUTORS" as listed above. LICENSE
This library is free software and may be distributed under the same terms as perl itself. perl v5.14.2 2012-04-08 strictures(3pm)
All times are GMT -4. The time now is 09:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy