summaryrefslogtreecommitdiffstats
path: root/scripts/newer
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:47:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:47:26 +0000
commit96b619cc129afed52411b9fad3407037a1cb7207 (patch)
treee453a74cc9ae39fbfcb3ac55a347e880413e4a06 /scripts/newer
parentInitial commit. (diff)
downloadexim4-96b619cc129afed52411b9fad3407037a1cb7207.tar.xz
exim4-96b619cc129afed52411b9fad3407037a1cb7207.zip
Adding upstream version 4.92.upstream/4.92upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xscripts/newer21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/newer b/scripts/newer
new file mode 100755
index 0000000..24c09e8
--- /dev/null
+++ b/scripts/newer
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+# 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