summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/mv-if-diff
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-08-19 10:13:38 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-08-19 10:13:38 +0000
commit14856225739aa48b6c9cf4c17925362b2d95cea3 (patch)
treedfd38f1b654fb5bbdfc38887c1a829b658e71530 /gnu/usr.bin/perl/mv-if-diff
parent77469082517e44fe6ca347d9e8dc7dffd1583637 (diff)
Import of Perl 5.003 into the tree. Makefile.bsd-wrapper and
config.sh.OpenBSD are the only local changes.
Diffstat (limited to 'gnu/usr.bin/perl/mv-if-diff')
-rw-r--r--gnu/usr.bin/perl/mv-if-diff14
1 files changed, 14 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/mv-if-diff b/gnu/usr.bin/perl/mv-if-diff
new file mode 100644
index 00000000000..1112a10dd3e
--- /dev/null
+++ b/gnu/usr.bin/perl/mv-if-diff
@@ -0,0 +1,14 @@
+: mv-if-diff file1 file2
+: move file1 to file2 if file1 and file2 are different.
+
+if test $# -lt 2 ; then
+ echo "usage: $0 file1 file2"
+ echo "move file1 to file2 if file1 and file2 are different."
+ exit 1
+fi
+if cmp $1 $2 >/dev/null 2>&1; then
+ echo "File $2 not changed."
+ rm -f tmp
+else
+ mv $1 $2
+fi