mlib update: implementation updates
[tangerine.git] / scripts / moveifchanged
blob9c8217ac7bf363568f231c093fa60be300c3bd70
1 #!/bin/sh
3 # $0 new old
5 # Replaces old with new if they differ. old is saved as old.bak
8 if cmp -s "$1" "$2"; then
9 echo "$2 is unchanged"
10 rm "$1"
11 else
12 echo "Replacing $2 by $1"
13 if [ -f "$2" ]; then
14 mv "$2" "$2.bak"
16 mv "$1" "$2"