projects
/
unix-history
/ blame
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blob
|
blame
(incremental) |
history
|
HEAD
BSD 4_4_Lite2 development
[unix-history]
/
usr
/
src
/
contrib
/
gcc-2.3.3
/
move-if-change
Commit
Line
Data
1e8aeceb
C
1
#!/bin/sh
2
# Like mv $1 $2, but if the files are the same, just delete $1.
3
# Status is 0 if $2 is changed, 1 otherwise.
4
if
5
test -r $2
6
then
7
if
8
cmp $1 $2 > /dev/null
9
then
10
echo $2 is unchanged
11
rm -f $1
12
else
13
mv -f $1 $2
14
fi
15
else
16
mv -f $1 $2
17
fi