home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume24
/
untic
/
untic.tst
< prev
Wrap
Text File
|
1991-06-05
|
2KB
|
74 lines
# List of file comes from stdin
# Get list with "find /usr/lib/terminfo -type f -print | sort > tlist"
#
# Written by: Joe Wasik, Unix/C Reusable Code Library
# jcwasik@clib.PacBell.COM
#
# This compares the output of "infocmp" with "untic" for all files in the
# terminfo library. If this does not report major problems, then "untic"
# is in working order for your machine.
#
# Of course, if you can run this script, then you have infocmp, and really
# don't need this program.
#
# Use this lib as input
TERMINFO=/usr/lib/terminfo
# Put temp files here
TMP=/tmp/untic$$
# Remove all temp files
trap "rm -f ${TMP} ${TMP}a infocmp.fil untic.fil; exit" 0 1 2 3
# Create check file
>${TMP}
# Read through each entry
while read FILEPATH
do
# get filename part
BASENAME=`basename $FILEPATH`
# tell user where we are
echo FILE:$BASENAME '\c'
# create file as base for comparison
/usr/bin/infocmp $BASENAME > ${TMP}a
if [ $? -ne 0 ]
then
echo "infocmp failed"
continue
fi
# get line 1 from infocmp file
LINE1=`cat ${TMP}a | line`
# get item1 from line1 from infocmp file
TERM=`echo $LINE1 | cut -f1 -d\|`
# tell user term name
echo TERM:$TERM '\c'
# see if already checked
grep "^$TERM$" ${TMP} > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo 'already checked'
continue
fi
# tell user this is a new one
echo 'checking...'
# write new term to checked list
echo $TERM >> $TMP
# from infocmp file, convert all entries to multi-line sorted
# with no spaces or tabs.
cat ${TMP}a |
sed -e 's/,/\
/g' -e 's/[ ]//g' | sed -e '/^$/d' | sort > infocmp.fil
# do same with untic output as we did with infocmp output
./untic $BASENAME |
sed -e 's/,/\
/g' -e 's/[ ]//g' | sed -e '/^$/d' | sort > untic.fil
if [ $? -ne 0 ]
then
echo "untic failed"
continue
fi
# do comparison -- allow diff to write to standard out
diff infocmp.fil untic.fil
done
echo
echo "-- done --"
exit 0
# @(#)untic.tst UCLID 1.1