Hopefully the final lot of test files.
[exim.git] / src / scripts / newer
CommitLineData
61ec970d
PH
1#! /bin/sh
2# $Cambridge: exim/src/scripts/newer,v 1.1 2004/10/06 15:07:40 ph10 Exp $
3
4# Script to determine whether the first file is newer than the second.
5# If the first does not exist, the answer is "no";
6# if the second does not exist, the answer is "yes";
7# otherwise their ages are compared using "find".
8
9if [ $# -ne 2 ]; then
10 echo "*** Two file names needed for 'newer' ***"
11 exit 2;
12fi
13
14if [ ! -f $1 ]; then exit 1; fi
15if [ ! -f $2 ]; then exit 0; fi
16
17case `find $1 -newer $2 -print` in
18'') exit 1;;
19*) exit 0;;
20esac
21
22# End