ksh compare dates INSIDE a file (ie date A is > date B)
In KSH, I am pasting 2 almost identical files together and each one has a date and time on each line. I need to determine if the first instance of the date/time is greater than the 2nd instance of the date/time. If the first instance is greater, I just need to echo that line.
I thought I would need to change the dates/times to epoch seconds but I can't figure out how to do update every date/time in the files to epoch. I'm not even sure if this would be the best way. Below is a snip from the joined files:
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT DEBIAN
ibdm-topo-file
IBDM-TOPO-FILE(1) IB DATA MODEL PACKAGE IBDM-TOPO-FILE(1)NAME
ibdm-topo-file - 1IBDM Topology File
DESCRIPTION
The topology file describes the IB connectivity and systems included in the network. It serves two purposes:
1. Support for arbitrary system names to be later used in every report that IBDM generates.
2. Connectivity verification: The specified network topology is verified against the discovered one. Mismatch errors resulting from missing
cables and/or wrong connections are reported by IBADM.
The topology file is composed "system" sections. Each such section describes the connectivity of one system to other systems in the
network. The first line of each section is a declaration of the system composed of a system-type, its system-name section, and optional
configuration details. The lines to follow until the next empty line describe the connections between this system ports to the other
systems. The following is a formal definition of a system section syntax.
An example is listed afterwards.
SYSTEM-TYPE SYSTEM-NAME [CFG: <b1>=<modifier>, [<b2>=<modifier>]...]
LOCAL-PORT-PANEL-NAME -> REM-SYS-TYPE REM-SYS-NAME REM-PORT-PANEL-NAME
LOCAL-PORT-PANEL-NAME -> REM-SYS-TYPE REM-SYS-NAME REM-PORT-PANEL-NAME
LOCAL-PORT-PANEL-NAME -> REM-SYS-TYPE REM-SYS-NAME REM-PORT-PANEL-NAME
. . .
SYSTEM-TYPE SYSTEM-NAME [CFG: <b1>=<modifier>, [<b2>=<modifier>]...]
LOCAL-PORT-PANEL-NAME -> REM-SYS-TYPE REM-SYS-NAME REM-PORT-PANEL-NAME
LOCAL-PORT-PANEL-NAME -> REM-SYS-TYPE REM-SYS-NAME REM-PORT-PANEL-NAME
. . .
. . .
Where:
SYSTEM-TYPE and REM-SYS-TYPE
Any system that has a corresponding IBNL definition. See man ibdm-ibnl-file
SYSTEM-NAME
The name of the system described in this topology file section.
LOCAL-PORT-PANEL-NAME
The name of the local system port. The numbers printed on the front panel are used together with Ln for Leaf no. N or Sn for Spine no.
N.
REM-SYS-NAME
The name of the system connected to the local port.
REM-PORT-PANEL-NAME
A name of the remote system port. We use the numbers as printed on the front panel and Ln for Leaf number N or Sn for Spine number N.
EXAMPLE
The following is a topology file for a simple cluster with one 24 port switch and two HCAs. The firts HCA named H-1 and connect to the
fabric with its two ports. The second HCA named H-2. The switch is of type MTS2400 and is named S-1
MTS2400 S-1
P1 -> MT23108 H-1 P1
P2 -> MT23108 H-1 P2
P24 -> MT23108 H-2 P1
OPTIONAL CFG SECTION
This section in the system declaration line describes the special customization of each board of the system.
That is the CFG string is a set of comma-separated sub-fields. Each sub-field describes some special configuration of a corresponding
system board. The actual semantics of the specific board modifiers is defined by the IBNL of the specific system.
EXAMPLE
The following is an example of a definition-line in a topology file of the MTS9600 switch system. This switch system can have up to eight
leafs and four spines. This example of the MTS9600 lacks (R) leafs no.6,7 and 8, and lacks spines no. 3 and 4.
MTS9600 PartialGz1 CFG: leaf3=R,leaf5=R,leaf7=R,spine1=R
AUTHOR
Eitan Zahavi, Mellanox Technologies LTD, eitan@mellanox.co.il
IBDM 1.0 2009-02-16 IBDM-TOPO-FILE(1)