File:  [Apple XNU] / GNUtools / cc / move-if-change
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:45:28 2018 UTC (8 years, 2 months ago) by root
Branches: MAIN, Apple
CVS tags: HEAD, GNUtools33
GNU tools for NeXTSTEP 3.3

#!/bin/sh
# Like mv $1 $2, but if the files are the same, just delete $1.
# Status is 0 if $2 is changed, 1 otherwise.
if
test -r $2
then
if
cmp -s $1 $2
then
echo $2 is unchanged
rm -f $1
else
mv -f $1 $2
fi
else
mv -f $1 $2
fi

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.