summaryrefslogtreecommitdiff
path: root/move-if-change
diff options
context:
space:
mode:
authorDave Love <fx@gnu.org>1999-10-03 15:56:58 +0000
committerDave Love <fx@gnu.org>1999-10-03 15:56:58 +0000
commita4a9692da15ec1531a5075b671b62ebf1f2b9d92 (patch)
tree13d2395598273a1e6667211e29c6d286480d65b6 /move-if-change
parentd7f3b2023f6105f04e90791ee19efd5a872ce33a (diff)
downloademacs-a4a9692da15ec1531a5075b671b62ebf1f2b9d92.tar.gz
#
Diffstat (limited to 'move-if-change')
-rwxr-xr-xmove-if-change15
1 files changed, 15 insertions, 0 deletions
diff --git a/move-if-change b/move-if-change
new file mode 100755
index 00000000000..ee9e355e3e6
--- /dev/null
+++ b/move-if-change
@@ -0,0 +1,15 @@
+#!/bin/sh
+if
+test -r $2
+then
+if
+cmp $1 $2 > /dev/null
+then
+echo $2 is unchanged
+rm -f $1
+else
+mv -f $1 $2
+fi
+else
+mv -f $1 $2
+fi