mvifdiff.sh 388 B

123456789101112131415
  1. #!/bin/sh
  2. # Copyright 2014 The Go Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style
  4. # license that can be found in the LICENSE file.
  5. # The mvifdiff.sh script works like the mv(1) command, except
  6. # that it does not touch the destination file if its contents
  7. # are the same as the source file.
  8. if cmp -s "$1" "$2" ; then
  9. rm "$1"
  10. else
  11. mv "$1" "$2"
  12. fi