home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Unix System Administration Handbook 1997 October
/
usah_oct97.iso
/
news
/
cnews.tar
/
maint
/
histfrom
< prev
next >
Wrap
Text File
|
1994-08-25
|
607b
|
36 lines
#! /bin/sh
# histfrom - get history-file entries between two dates
# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/etc/news/bin/config}
PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK
case $# in
1) start="$1"
end=`now`
ender=echo
;;
2) start="$1"
end="$2"
ender=getabsdate
;;
*) echo "Usage: $0 startdate [enddate]" >&2
exit 2
;;
esac
if start=`getabsdate "$start"` && end=`$ender "$end"`
then
: okay
else
exit 1
fi
egrep ' .* ' $NEWSCTL/history | awk -F' ' '{
n = split($2, subf, "~")
arrived = subf[1]
if (arrived >= '$start' && arrived <= '$end')
print
}'