summaryrefslogtreecommitdiff
path: root/src/scripts/newer
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2004-10-06 15:07:39 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2004-10-06 15:07:39 +0000
commit61ec970df30325dbcd8c9d0f0e431dc793126656 (patch)
tree3534a7ab9d9a1e57651821184e6c28a25ee0e8de /src/scripts/newer
parent0f4f2a8848bf9e6bb323ffb6a5581b088a940fd0 (diff)
Start
Diffstat (limited to 'src/scripts/newer')
-rwxr-xr-xsrc/scripts/newer22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/scripts/newer b/src/scripts/newer
new file mode 100755
index 000000000..a2b92f6b8
--- /dev/null
+++ b/src/scripts/newer
@@ -0,0 +1,22 @@
+#! /bin/sh
+# $Cambridge: exim/src/scripts/newer,v 1.1 2004/10/06 15:07:40 ph10 Exp $
+
+# Script to determine whether the first file is newer than the second.
+# If the first does not exist, the answer is "no";
+# if the second does not exist, the answer is "yes";
+# otherwise their ages are compared using "find".
+
+if [ $# -ne 2 ]; then
+ echo "*** Two file names needed for 'newer' ***"
+ exit 2;
+fi
+
+if [ ! -f $1 ]; then exit 1; fi
+if [ ! -f $2 ]; then exit 0; fi
+
+case `find $1 -newer $2 -print` in
+'') exit 1;;
+*) exit 0;;
+esac
+
+# End