summaryrefslogtreecommitdiff
path: root/move-if-change
blob: ee9e355e3e61d569f9102f4387b108c3cf6dfa04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
if
test -r $2
then
if
cmp $1 $2 > /dev/null
then
echo $2 is unchanged
rm -f $1
else
mv -f $1 $2
fi
else
mv -f $1 $2
fi