home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Unix System Administration Handbook 1997 October
/
usah_oct97.iso
/
news
/
cnews.tar
/
expire
/
dircheck
next >
Wrap
Text File
|
1990-03-06
|
545b
|
34 lines
#! /bin/sh
# dircheck -- checker for expire regression testing
case "$1" in
-n) invert=yes ; shift ;;
esac
for f in `sed 's/.* //;s:\.:/:g'`
do
if test " $invert" = " "
then
if test ! -f $1/$f
then
echo "cannot find $1/$f" >&2
exit 1
fi
it="`cat $1/$f`"
if test " $it" = " $f" || expr " $it" : ".*:$f:.*" >/dev/null
then
: okay
else
echo "contents of $1/$f are wrong" >&2
exit 1
fi
else
if test -f $1/$f
then
echo "found $1/$f, shouldn't have" >&2
exit 1
fi
fi
done
exit 0 # for stupid shells