Debian Codegraph @

xbin/move-if-changed

raw
1 #!/bin/sh
2
3 if [ $# -eq 3 ] ; then MOVE=$1 ; shift 1; else MOVE=ln;fi
4
5 F1=$1
6 F2=$2
7
8
9 if [ $# -ge 2 ] && [ -f $2 ] && cmp $1 $2 > /dev/null
10 then echo $1 and $2 are identical ;
11 else
12 echo $1 and $2 were not the same.
13 rm -f $2
14 ${MOVE} $1 $2
15 echo ln $1 $2
16 fi
17