Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix "if' statement -nt condition 1

Status
Not open for further replies.

ddeleo

Programmer
Jul 26, 2004
2
US
Is anyone familiar with the -nt condition of the if statment in Unix scripting (ie. if [[ file1 -nt file2 ]] ). Where can I find more information on it. It was used in an old script and I need to ensure what it is doing is what we think it is doing. In fact I almost believe it has limitations. It looks like it is being used to compare two files timestamps, however the limitation I am finding is it may not be able to compare files that are to close in milliseconds with their time stamps. Any thoughts, opinions or locations to find info on this would be truly appreciated. - Thanks!
 
man test
man ksh

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
files that are to close in milliseconds with their time stamps
The standard unix timestamp is the number of seconds since the epoch (01/01/1970 if I remember well), so you have no chance to distinguish two file's timestamps on a millisecond basis.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top