The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-19-2002
Bab00shka Bab00shka is offline
Registered User
  
 

Join Date: Apr 2002
Location: Chesterfield, UK
Posts: 123
Try this:

if [ `find xfile -newer yfile` ]
then
echo "xxx"
fi

In the above we are testing for a string to be returned.

If xfile is newer than yfile then the find statement will return the string "xfile", hence the test will be true and perform the if statement.

If xfile is not newer than yfile then the find statement will not return anything, so the test will be false and the if statement will not be performed.

Let me know how you get on.

Cheers
Helen