Thanks for help.
--
Frank Hung-Fa Sun
Computer & Comm. Research Lab. /ITRI
Internet: su...@e0sun3.ccl.itri.org.tw
Voice: (886-035)917255, FAX: 820098
Some shell-independent methods:
find file1 -newer file2 -print
prints "file1" if it is newer than file2, otherwise nothing
ls -t file1 file2
lists the files in timestamp order, newest first
(use ls -tr for oldest first)
To use these in shell scripts, you can test their outputs, eg:
Bourne, etc:
if [ -n "`find file1 -newer file2 -print`" ]
then
...
fi
Csh:
if(`find file1 -newer file2 -print` != "") then
...
endif
Hope this helps!
--
===============================================================================
Dave | d...@imp.co.uk | +44 753 516599 | I calculate; you figure; he guesses.
===============================================================================
find filename1 -newer filename2 -print
This will print filename1 only it is newer than filename2
-Alun
--
| *I'm as bad as the worst - but thank God(?) I am as good as the best.* |
| --------------------------------------------------------------------------- |
| A.Champion : cham...@uk.ac.cov.cch (Student account) |
| stl...@uk.ac.cov.cch (Student liaison account) |