summaryrefslogtreecommitdiff
path: root/libgo/mvifdiff.sh
blob: 6706e40de409ab2be63d306eb1120056f6a164d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# Copyright 2014 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

# The mvifdiff.sh script works like the mv(1) command, except
# that it does not touch the destination file if its contents
# are the same as the source file.

if cmp -s "$1" "$2" ; then
  rm "$1"
else
  mv "$1" "$2"
fi