Sponsored Content
Full Discussion: date comparision
Operating Systems Solaris date comparision Post 302098388 by Hitesh Shah on Monday 4th of December 2006 01:30:39 AM
Old 12-04-2006
date comparision

I am wriitng a shell script to compare a date in `date +%Y%m%d%H%M` to the output of `cat /var/adm/messages.0 | grep Temp |grep "CPU Fans" | cut -f1-4,19 -d' '` which looks like

Dec 2 11:30:57 79
Dec 2 11:37:58 79
Dec 2 11:44:58 79
Dec 2 11:50:59 79
Dec 2 11:58:00 79
Dec 2 12:05:01 79
Dec 2 12:11:01 79
Dec 2 12:18:02 79
Dec 2 12:21:02 80

How can I do this . My main issue is abbreviated month description .

Many thanks in advance
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

date comparision

Hello, I am trying to compare two dates which are in variables and i am not getting the correct result as expected. $first_date = '07/19/2007' $second_date='07/20/2007' Can you please suggest how to i check whether they are equal or not. if ($first_date -eq $second_date) condition is not... (3 Replies)
Discussion started by: kotasateesh
3 Replies

2. Shell Programming and Scripting

while - comparision

Hi, Please find the attached scriplet and suggest me to fix the bug in this. ----------------------------------- noofdirs=`ls *.tar | wc -l` if ; then let i=1 while ( $i <= $noofdirs ) ; do echo $i mkdir $i file1=`ls *.tar | head -1` mv $file1 $i i =... (2 Replies)
Discussion started by: sharif
2 Replies

3. Shell Programming and Scripting

Date Comparision in the File

Hi All, I have thefollowing files in the directory inbox/sat ras.sat.trn.20090103.001902.00004358 ras.sat.trn.20090612.001903.00005339 ras.sat.trn.20090723.001902.00004358 The above file contains the date of the file creation. We just need to write a ksh shell script to check the... (5 Replies)
Discussion started by: satheesh_color
5 Replies

4. Shell Programming and Scripting

Problem with Date Comparision

Hi, I have a file which has the date in the last line in the example pasted along with the rates of the countries. -- I want to compare the date in the last line of the file mentioned in the example below with the system date from Monday to Friday. -- If system date is equal to the date... (2 Replies)
Discussion started by: Raji_gadam
2 Replies

5. Shell Programming and Scripting

problem in date comparision

#!/bin/ksh var="2009-08-31 12:39:05 UTC" ddate=`echo $var|cut -d' ' -f1` y1=`echo $ddate|cut -d'-' -f1` m1=`echo $ddate|cut -d'-' -f2` d1=`echo $ddate|cut -d'-' -f3` filedate=$y1$m1$d1 currdate="20070814" if ]; then echo "$LINE -> $filedate LOWER THAN $currdate" ... (0 Replies)
Discussion started by: HemaV
0 Replies

6. Programming

Problem with date comparision in Pro*C

Hi, I have written the following Pro*C program to get the difference between 2 dates.But when I am printing the value of the date difference,it is always showing 0. #include<stdio.h> #include<sqlca.h> #include<oraca.h> void main() { EXEC SQL BEGIN DECLARE SECTION; int diff; ... (4 Replies)
Discussion started by: sureshbabuc
4 Replies

7. Shell Programming and Scripting

Date - String comparision

Hi, I am having difficulty to compare a string in a file against a date from a a table and print the latest date. Below are the values. String in File : 2009-12-02 00:37:51 Value Table : 2010-01-10-02.00.49.294758 I have to compare both the values ( Ignore the Microsecond in the table... (5 Replies)
Discussion started by: sam_78_nyc
5 Replies

8. Shell Programming and Scripting

Date Manipulation and Comparision

Hi All, I want to generate quarter dates using awk or anything, by giving a dates as input for example : start_date=2010-01-01 end_date=2010-05-31 output should be: start_date end_date qtr 2010-01-01 2010-03-31 1 2010-04-01 2010-05-31 2 Example 2:... (1 Reply)
Discussion started by: sol_nov
1 Replies

9. Shell Programming and Scripting

Date comparision in Unix

Hi All, I would need your help to compare dates in my script. Say if I have the dates in a file I need to comapre these dates with yesterday's date and the dates which are older than yesterday needs to be displayed. Example: 03/22/2012 03/24/2012 03/20/2012 03/21/2012 03/12/2012... (1 Reply)
Discussion started by: pdreddy34
1 Replies

10. Shell Programming and Scripting

Date command comparision with a different format

I have a script called " passwd_status " which gives the passwd-s status of my servers. the script output is like below password status for A: abc ks 10/05/115 1 30 ps password status for B: abc ks 09/25/115 1 30 ps password status for C: abc ks 10/10/115 1 30 ps Now , i want to... (1 Reply)
Discussion started by: charanarjun
1 Replies
imwcs(1)						      General Commands Manual							  imwcs(1)

Name
       imwcs - Set WCS in FITS and IRAF image files

Synopsis
       imwcs [options] FITS or IRAF filename

Description
       imwcs (pronounced im-W-C-S) is a utility for setting the world coordinate system (WCS) of a FITS or IRAF image. The WCS is the relationship
       between sky coordinates and image pixels and can be described in a standard way in the header of an image. The program was originally writ-
       ten at the University of Iowa, but has been adapted and amplified by Doug Mink at the Smithsonian Astrophysical Observatory.

       imwcs  currently  works	only on images where the rotation about the center is known to within a few degrees It has been tested extensively
       only on images with near-zero rotation.

       A plane-tangent projection (center right ascension and declination, plate scale, and rotation angle) is fit based on matches between  stars
       in  the image and stars in a reference catalog. The HST Guide Star Catalog, the USNO A 1.0, SA 1.0, or UJ Catalog, or a user-supplied, tab-
       delimited Starbase catalog may be used.

Options
       -a <angle>
	      Initial rotation angle in degrees (default 0)

       -b <RA> <Dec>
	      Initial center in B1950 (FK4) RA and Dec (default=RA,DEC from file)

       -c <catalog name>
	      Reference catalog (gsc(=HST GSC), ua2(=USNO-A2.0), TMC(=2MASS Point Source Catalog), gsc2(=GSC  II),  ub1(=USNO-B1.0),  local  file,
	      etc.)

       -d <catalog name>
	      Use  this  DAOFIND  output  catalog of X, Y, and magnitude instead of searching for stars in the image.  The format is simply white-
	      space-separated X, Y, and magnitue on a line, with # at the beginning of comment lines.

       -e     Erase image WCS keywords, getting initial WCS from command line

       -f     Write FITS output no matter what input

       -g <class>
	      Guide Star Catalog class (-1=all,0,3) (default -1)

       -h <number>
	      Change the maximum number of reference stars to match from 25 to

       -i <counts>
	      Minimum peak value for star in image.  If negative, use -<counts> standard deviations as minimum.

       -j <RA> <Dec>
	      Initial center in J2000 (FK5) RA and Dec (default=RA,DEC from file)

       -k <magnum>
	      Use this magnitude to sort brightest catalog stars.

       -l     Reflect left<->right before rotating and fitting

       -m [<bright magnitude>] <faint magnitude>
	      Limiting catalog magnitude(s) (default none, bright -2 if only faint is given)

       -n <number>
	      Number of parameters to fit (1-8, or digit string). The default is 2 (RA+Dec) if <3 stars are matched, 3 (RA+Dec+scale) if <5  stars
	      are  matched,  or 4 (RA+Dec+scale+rot) if 5 or more stars are matched.  Alternatively this may be a list of all of the parameters to
	      fit, in the form nnnnnn.., where 1=RA, 2=Dec, 3=RA scale, 4=Dec scale, 5=rotation angle, 6=Y axis rotation (CD matrix), 7=RA  refer-
	      ence pixel, and 8=Dec reference pixel.

       -o <filename>
	      Write output to this file; may be the same as input file.  This option automatically sets the -w option to write the file.

       -p <scale>
	      Initial plate scale in arcsec per pixel (default 0)

       -q <option list>
	      <i>terate,  <r>ecenter,  <s>igma	clip,  <p>olynomial,  <t>olerance  reduce (half for each iteration).  A number following an option
	      repeats the option that many times.

       -r <angle>
	      Rotation angle in degrees before fitting (0, 90, 180, 270) (default 0)

       -s <frac>
	      Use this fraction extra stars (default 1.0)

       -t <num>
	      Offset tolerance in pixels (default 20)

       -u <file>
	      File of X Y RA Dec assignments for initial WCS

       -v     Verbose listing of processing intermediate results

       -w     Write WCS to a new file (default is read-only) -x X and Y coordinates of reference pixel (default is image center) -y multiply image
	      dimensions  by  this  for search (default is 1) -z Use AIPS classic projections instead of WCSLIB; use CD matrix or CDELT instead of
	      polynomial solution.

Web Page
       http://tdc-www.harvard.edu/software/wcstools/imwcs/

Author
       Doug Mink, SAO (dmink@cfa.harvard.edu)

30 January 2003 						     WCSTools								  imwcs(1)
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy