This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
allow spaces in -I switch argument
[perl5.git] / mv-if-diff
CommitLineData
a0d0e21e
LW
1: mv-if-diff file1 file2
2: move file1 to file2 if file1 and file2 are different.
3
4if test $# -lt 2 ; then
5 echo "usage: $0 file1 file2"
6 echo "move file1 to file2 if file1 and file2 are different."
7 exit 1
8fi
9if cmp $1 $2 >/dev/null 2>&1; then
10 echo "File $2 not changed."
23b65447 11 rm -f $1
a0d0e21e 12else
28e8609d 13 rm -f $2
a0d0e21e
LW
14 mv $1 $2
15fi