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.os2
< prev
next >
Wrap
Text File
|
1996-10-04
|
1KB
|
41 lines
#!D:/bin/os2/bin/sh.exe
#
# 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.exe ${OKAY};
fi
if [ ! -f ${OKAY}/${FILE} ] ;
then
echo "${FILE} is new" ;
cp.exe ${FILE} ${OKAY}/${FILE} ;
fi
if diff.exe ${OKAY}/${FILE} ${FILE} ;
then
rm.exe -f -f ${FILE} ;
echo '.' | gawk.exe '{printf("%s",$1);}' ;
else
touch CHECK_FAILED
echo "--------------------------------------------------" ;
echo "Differences in ${OKAY}/${FILE} ${VARY}/${FILE} :" ;
if [ ! -d ${VARY} ] ;
then
echo "Creating directory ${VARY}" ;
mkdir.exe ${VARY} ;
fi
mv.exe ${FILE} ${VARY}/${FILE} ;
diff.exe ${OKAY}/${FILE} ${VARY}/${FILE} ;
fi
exit 0