home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
fchk294s.zip
/
ftnchek-2.9.4
/
test
/
Compare.sh.in
< prev
next >
Wrap
Text File
|
1996-10-02
|
958b
|
41 lines
#!/bin/sh
#
# Bourne shell script to compare File in directory ./Vary with
# original in directory ./Okay and print differences if any.
# If no differences it echoes a dot to show progress.
# If differences, touches file CHECK_FAILED
#
# Usage: Compare.sh Okay Vary File
OKAY=$1
VARY=$2
FILE=$3
if [ ! -d ${OKAY} ] ;
then
echo "Creating directory ${OKAY}" ;
mkdir ${OKAY};
fi
if [ ! -f ${OKAY}/${FILE} ] ;
then
echo "${FILE} is new" ;
@CP@ ${FILE} ${OKAY}/${FILE} ;
fi
if @CMP@ ${OKAY}/${FILE} ${FILE} ;
then
@RM@ ${FILE} ;
echo '.' | @AWK@ '{printf("%s",$1);}' ;
else
touch CHECK_FAILED
echo "--------------------------------------------------" ;
echo "Differences in ${OKAY}/${FILE} ${VARY}/${FILE} :" ;
if [ ! -d ${VARY} ] ;
then
echo "Creating directory ${VARY}" ;
mkdir ${VARY} ;
fi
@MV@ ${FILE} ${VARY}/${FILE} ;
@DIFF@ ${OKAY}/${FILE} ${VARY}/${FILE} ;
fi
exit 0