Have a look at this page for the complete list of test-expression used with if -N option - True if FILE exists and has been modified since it was last read. I guess this is what you are looking for!
#!/bin/sh
It does not work. It gives me only NO. $3 $4$5$6 my files
file=$1
target=$2
while read line
do
if [ "$line" != "" ]
then
set $line
if [ "$1" = "$target" ]
then
if [ "$2" = ":" ]
then
for i in $3 $4 $5 $6
do
-N i && echo yes || echo no
done
fi
fi
fi
done< $file
---------- Post updated at 01:19 PM ---------- Previous update was at 01:15 PM ----------
Dear Expert,
Is there a command to do that in Unix?
In such a way that we don't need to actually "write" or
modified the content.
-- monkfan (4 Replies)
Assume, I created one file three years back and I like to move the file to some other directory with the old date (Creation date)? Is it possible? Explain? (1 Reply)
Hi guys,
I had a scenario...
1. I had to get the previous days date in yyyymmdd format
2. i had to create a file with Date inthe format yyyymmdd.txt format
both are different
thanks guys in advance.. (4 Replies)
Hello gurus,
I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4:
NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
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)
hi there
I have file names in different format as below
triss_20111117_fxcb.csv
triss_fxcb_20111117.csv
xpnl_hypo_reu_miplvdone_11172011.csv
xpnl_hypo_reu_miplvdone_11-17-2011.csv
xpnl_hypo_reu_miplvdone_20111117.csv
xpnl_hypo_reu_miplvdone_20111117xfb.csv... (10 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 have files like
1)20131112_abc_01.csv and
2)20131113_abc_01.csv and
3)20131113_abc_02.csv
when i try to fetch the file in the next day. it shud pick the third file..
plz help me..
and i use `date +"%Y%m%d"` command to fetch..it fetches the current date... (2 Replies)
I have file listed like below
-rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz
-rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz
-rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz
-rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz
-rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz
I... (5 Replies)
We want to call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below:
abc.txt
------------------
Code:
line1
line2
line3
$$EDWS_DATE_INSERT=08-27-2019
line4
$$EDWS_PREV_DATE_INSERT=08-26-2019
I am trying to write a... (3 Replies)
Discussion started by: pradeepp
3 Replies
LEARN ABOUT DEBIAN
ost_date
ost::Date(3) Library Functions Manual ost::Date(3)NAME
ost::Date -
The Date class uses a julian date representation of the current year, month, and day.
SYNOPSIS
#include <numbers.h>
Inherited by ost::DateNumber, and ost::Datetime.
Public Member Functions
Date (time_t tm)
Date (tm *dt)
Date (char *str, size_t size=0)
Date (int year, unsigned month, unsigned day)
Date ()
virtual ~Date ()
int getYear (void) const
unsigned getMonth (void) const
unsigned getDay (void) const
unsigned getDayOfWeek (void) const
char * getDate (char *buffer) const
time_t getDate (void) const
time_t getDate (tm *buf) const
long getValue (void) const
void setDate (const char *str, size_t size=0)
bool isValid (void) const
operator long () const
String operator() () const
Date & operator++ ()
Date & operator-- ()
Date & operator+= (const long val)
Date & operator-= (const long val)
int operator== (const Date &date)
int operator!= (const Date &date)
int operator< (const Date &date)
int operator<= (const Date &date)
int operator> (const Date &date)
int operator>= (const Date &date)
bool operator! () const
Protected Member Functions
void toJulian (long year, long month, long day)
void fromJulian (char *buf) const
virtual void update (void)
A method to use to 'post' any changed values when shadowing a mixed object class.
Protected Attributes
long julian
Friends
Date operator+ (const Date &date, const long val)
Date operator- (const Date &date, const long val)
Date operator+ (const long val, const Date &date)
Date operator- (const long val, const Date &date)
Detailed Description
The Date class uses a julian date representation of the current year, month, and day.
This is then manipulated in several forms and may be exported as needed.
Author:
David Sugar dyfet@ostel.com julian number based date class.
Constructor & Destructor Documentation
ost::Date::Date (time_ttm)
ost::Date::Date (tm *dt)
ost::Date::Date (char *str, size_tsize = 0)
ost::Date::Date (intyear, unsignedmonth, unsignedday)
ost::Date::Date ()
virtual ost::Date::~Date () [virtual]
Member Function Documentation
void ost::Date::fromJulian (char *buf) const [protected]
char* ost::Date::getDate (char *buffer) const
time_t ost::Date::getDate (void) const
time_t ost::Date::getDate (tm *buf) const
unsigned ost::Date::getDay (void) const
unsigned ost::Date::getDayOfWeek (void) const
unsigned ost::Date::getMonth (void) const
long ost::Date::getValue (void) const
int ost::Date::getYear (void) const
bool ost::Date::isValid (void) const
Reimplemented in ost::Datetime.
ost::Date::operator long () const [inline]
bool ost::Date::operator! (void) const [inline]
Reimplemented in ost::Datetime.
int ost::Date::operator!= (const Date &date)
String ost::Date::operator() () const
Date& ost::Date::operator++ ()
Date& ost::Date::operator+= (const longval)
Date& ost::Date::operator-- ()
Date& ost::Date::operator-= (const longval)
int ost::Date::operator< (const Date &date)
int ost::Date::operator<= (const Date &date)
int ost::Date::operator== (const Date &date)
int ost::Date::operator> (const Date &date)
int ost::Date::operator>= (const Date &date)
void ost::Date::setDate (const char *str, size_tsize = 0)
void ost::Date::toJulian (longyear, longmonth, longday) [protected]
virtual void ost::Date::update (void) [protected], [virtual]
A method to use to 'post' any changed values when shadowing a mixed object class. This is used by DateNumber.
Reimplemented in ost::DateNumber.
Friends And Related Function Documentation
Date operator+ (const Date &date, const longval) [friend]
Date operator+ (const longval, const Date &date) [friend]
Date operator- (const Date &date, const longval) [friend]
Date operator- (const longval, const Date &date) [friend]
Member Data Documentation
long ost::Date::julian [protected]
Author
Generated automatically by Doxygen for GNU CommonC++ from the source code.
GNU CommonC++ Sat Jun 23 2012 ost::Date(3)