The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
check timestamp on specific files grinds Shell Programming and Scripting 2 05-16-2008 12:01 PM
to get the timestamp of files from the files and folders in Unix kishan HP-UX 2 04-09-2008 05:20 AM
how to compare the timestamp of 2 files mail2sant Shell Programming and Scripting 2 04-07-2008 01:43 AM
ftp files -- but keep the original timestamp Perderabo Answers to Frequently Asked Questions 0 07-23-2006 08:43 AM
comparing timestamp of two files jyotipg Shell Programming and Scripting 2 04-06-2004 03:38 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-18-2005
Registered User
 

Join Date: Nov 2005
Posts: 21
Stumble this Post!
How do i check if 2 files have same timestamp?

How can i compare the time stamps of two files to check if they are the same. Is there any option like the -nt or -ot with the if clause? I have a file and i "cp -p" the file to a different location. If a copy of the file already exists, i dont want to copy it. I am also running multiple instances of the script that copies the file and i do not know the exact name of the file that gets copied because the script appends timestamp to filename at the time of copying.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-18-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,443
Stumble this Post!
If you have timestamps in the names, just compare the names. But you can do:
[[ $filea -nt $fileb || $filea -ot $fileb ]] && echo files have different mod times
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0