Article View: news.software.readers
Article #3824Re: .newsrc management
From: Larry W. Virden
Date: Tue, 06 Apr 1993 19:06
Date: Tue, 06 Apr 1993 19:06
44 lines
1968 bytes
1968 bytes
I wrote the following so that I could have such a function. I call it
ra (rn's apropos) and use it by saying
!ra string
from any prompt.
#! /bin/ksh
if [ ! "$1" ] ; then
echo USAGE: $0 pattern >&2
exit 1
fi
if [ -f /usr/lib/news/newsgroups ] ; then
# Did someone install the command incorrectly on this system?
file /usr/lib/news/newsgroups | fgrep -s /bin/sh
if [ "$?" -eq 0 ] ; then # Not the right one
rcp ${NNTPSERVER}:/usr/lib/news/newsgroups /tmp/newsgroups
if [ ! -f /tmp/newsgroups ] ; then
echo "$0: Unable to locate master newsgroup list for rn" >&2
exit 1
fi
rnmast=/tmp/newsgroups
else
rnmast=/usr/lib/news/newsgroups
fi
elif [ -f /tmp/newsgroups ] ; then
rnmast=/tmp/newsgroups
else
rcp ${NNTPSERVER}:/usr/lib/news/newsgroups /tmp/newsgroups
if [ ! -f /tmp/newsgroups ] ; then
echo "$0: Unable to locate master newsgroup list for rn" >&2
exit 1
fi
rnmast=/tmp/newsgroups
fi
awk '$1 ~ /'"$1"'/ { print $0 }' $rnmast
exit 0
--
--
Larry W. Virden INET: lvirden@cas.org
Personal: 674 Falls Place, Reynoldsburg, OH 43068-1614
Technical Details
Message-ID:
<1993Apr6.191020.7453@cas.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.misc.mbox.zip!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!zaphod.mps.ohio-state.edu!malgudi.oar.net!chemabs!lwv26References:
<1993Mar27.152541.10342@daimi.aau.dk> <1p3ba6$soq@nigel.msen.com> <NQF1B2VF@cc.swarthmore.edu>Show Full Headers
Complete Article Headers
Message-ID: <1993Apr6.191020.7453@cas.org> Subject: Re: .newsrc management Date: Tue, 6 Apr 1993 19:06:02 GMT From: lwv26@cas.org (Larry W. Virden) References: <1993Mar27.152541.10342@daimi.aau.dk> <1p3ba6$soq@nigel.msen.com> <NQF1B2VF@cc.swarthmore.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.misc.mbox.zip!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!zaphod.mps.ohio-state.edu!malgudi.oar.net!chemabs!lwv26 Newsgroups: news.admin.misc,news.software.readers Followup-To: news.software.readers Sender: usenet@cas.org Reply-To: lvirden@cas.org (Larry W. Virden) Organization: Nedriv Software and Shoe Shiners, Uninc. Lines: 43