donn (06/04/82)
I long ago became irritated with the scrolling problems which "readnews" has when it pipes its output through "more" and wondered if I couldn't do better with my own news interface. I have cooked up a cshell script which runs quickly and depends entirely on "more" for its interface. Thus I can use all the familiar ":p" and ":n" commands to walk through the list of articles and get the shell escapes and so on. Since it is built of (metaphorically) spit, string and old coat hangers it has disadvantages, the most costly of which is the inability to stop in the middle of a news reading session and pick it up again at the next login. It would be quite simple to modify the script so that it patched two other problems--it goes through the list of articles in "A news" fashion, in the order which articles arrived; and it doesn't allow selectivity in newsgroups. These don't bother me very much since I don't care what order I read newspapers in and my tastes are rather catholic (and I have a swift finger for skipping articles!). I have been using this interface for several months and have found it much more satisfactory than my previous few weeks with "readnews"... Here is the news reading script, which should be used by aliasing csh -f scriptname to readnews: # # Cshell script to read news with "more". Uses /usr/lib/news/history. # onintr err echo "/^`tail -1 /usr/lib/news/history | sed -e 's/\//\\\//g'`"'$/,$s/^.* //p' > ~/newnews cd /usr/spool/news more `sed -n -f ~/lastnews /usr/lib/news/history` /dev/null cd ~ mv lastnews oldnews mv newnews lastnews err: exit Here is a script that checks for new news: # # Look for new news. # cd ~/c if { fgrep -s `tail -1 /usr/lib/news/history | sed -e 's/ .*$//'` lastnews } then echo No news. else echo There is news. endif