05-25-2005
Quote:
Originally Posted by vivekshankar
Hi,
Is there any date compare functionality in unix?
thanks and regards
vivek.s
Once
again - pls use the "Search" and the "FAQ" capabilities of this site!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
I am currently running the following Korn shell script which works fine:
#!/usr/bin/ksh
count=`db2 -x "select count(*) from schema.tablename"`
echo "count"
I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename... (9 Replies)
Discussion started by: sasaliasim
9 Replies
3. Shell Programming and Scripting
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... (4 Replies)
Discussion started by: right_coaster
4 Replies
4. Shell Programming and Scripting
Hi! I am trying to read a file and every line has a specific date as one of its fields.
I want to take that date and compare it to the date today plus 6 days.
while read line
do
date=substr($line, $datepos, 8) #date is expected to be YYYYMMDD
if ; then
...proceed commands
... (1 Reply)
Discussion started by: kokoro
1 Replies
5. Shell Programming and Scripting
Hi,
I am new to this forum, searched, but for some reason did not find much help, so a new thread.
I am trying to compare date with a string which is in date format , but for some reason, system does not give me the right result.
Date is coming in a file and i am comparing the same with... (2 Replies)
Discussion started by: mkstool
2 Replies
6. Shell Programming and Scripting
hi all,
How to compare two files whether they are same are not...? like i had my input files as 20141201_file.txt and 20141130_file2.txt
how to compare the above files based on date .. like todays file and yesterdays file...? (4 Replies)
Discussion started by: hemanthsaikumar
4 Replies
7. Shell Programming and Scripting
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
8. UNIX for Beginners Questions & Answers
Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt .
I don't want to delete... (2 Replies)
Discussion started by: Stuti
2 Replies
9. Answers to Frequently Asked Questions
I m working on shell scripting and I m stuck where in my .txt file there is column as expiry date and I need to compare that date with system date and need to remove all the rows where expiry date is less than system date and create a new .txt with update. (1 Reply)
Discussion started by: Stuti
1 Replies
10. UNIX for Beginners Questions & Answers
Hi Community!
Following on from this code in another thread:
#!/bin/bash
file_string=`/bin/cat date.txt | /usr/bin/awk '{print $5,$4,$7,$6,$8}'`
file_date=`/bin/date -d "$file_string"`
file_epoch=`/bin/date -d "$file_string" +%s`
now_epoch=`/bin/date +%s`
if
then
#let... (2 Replies)
Discussion started by: Greenage
2 Replies
LEARN ABOUT DEBIAN
imager::color::float
Imager::Color::Float(3pm) User Contributed Perl Documentation Imager::Color::Float(3pm)
NAME
Imager::Color::Float - Rough floating point sample color handling
SYNOPSIS
$color = Imager::Color->new($red, $green, $blue);
$color = Imager::Color->new($red, $green, $blue, $alpha);
$color = Imager::Color->new("#C0C0FF"); # html color specification
$color->set($red, $green, $blue);
$color->set($red, $green, $blue, $alpha);
$color->set("#C0C0FF"); # html color specification
($red, $green, $blue, $alpha) = $color->rgba();
@hsv = $color->hsv(); # not implemented but proposed
$color->info();
DESCRIPTION
This module handles creating color objects used by Imager. The idea is that in the future this module will be able to handle color space
calculations as well.
A floating point Imager color consists of up to four components, each in the range 0.0 to 1.0. Unfortunately the meaning of the components
can change depending on the type of image you're dealing with:
o for 3 or 4 channel images the color components are red, green, blue, alpha.
o for 1 or 2 channel images the color components are gray, alpha, with the other two components ignored.
An alpha value of zero is fully transparent, an alpha value of 1.0 is fully opaque.
METHODS
new This creates a color object to pass to functions that need a color argument.
set This changes an already defined color. Note that this does not affect any places where the color has been used previously.
rgba()
This returns the red, green, blue and alpha channels of the color the object contains.
info
Calling info merely dumps the relevant color to the log.
AUTHOR
Arnar M. Hrafnkelsson, addi@umich.edu And a great deal of help from others - see the "README" for a complete list.
SEE ALSO
Imager(3), Imager::Color.
http://imager.perl.org/
perl v5.14.2 2011-06-06 Imager::Color::Float(3pm)