Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!csd4.milw.wisc.edu!indri!uflorida!novavax!twwells!bill From: bill@twwells.com (T. William Wells) Newsgroups: news.software.b Subject: Minor problems with C news Message-ID: <1989Jun22.061942.1751@twwells.com> Date: 22 Jun 89 06:19:42 GMT Organization: None, Ft. Lauderdale, FL Lines: 78 I have had several minor problems with C news. Following is a summary and suggested fixes. Some Makefiles have some lines like: test ! -r file These, not having a shell metacharacter, get exec'ed instead of sh -c'ed. Unfortunately, while test is a builtin, there is no /bin/test on my system. So those lines fail. The trivial fix is to put a semicolon at the end of those lines. The affected Makefiles are in batch, conf, expire, input, and libstdio. Another set of bugs is in inews. When grepping for Approved:, it does not redirect the output to /dev/null. Moreover, it tries to remove a nonexistent temp file immediately after and the rm does not have a -f flag after it to inhibit an error message. So, moderators get spurious messages when posting. In newsrun, the find bad... command prints an error message if there have been no bad batches in seven days because it tries to rm the `bad' directory. Since I never get corrupted batches (yay, Telebit!) this starting giving me a bogus message a week after installation. The find needs a -type f. Finally, the stdio stuff provided does not work on my Microport SysV/386 3.0e. Alternately, there is some, as yet undiscovered bug elsewhere, that ceases to be apparent when I stop using the stdio. A gripe: I want to run doexpire when I'm particularly low on disk space but I want it to do a different expire than is specified by explist; the script mentions explist explicitly. I might be able to get a similar effect by fiddling with the parameters in the explist file, but the documentation left me confused. Another gripe: I understand using shell scripts all over the place, though they really slow some things down, but did you *have* to use awk? It's awkfully slow! And, I think, unnecessary in many places. For example, I use expr instead in my version of spacefor. Following is the relevant part of my spacefor (for Microport SysV/386 3.0e): dfunit=512 # default unit (bytes) case "$2" in incoming) arg="$NEWSARTS/in.coming" ; desire=500 ;; articles) arg="$NEWSARTS" ; desire=2000 ;; control) arg="$NEWSCTL" ; desire=2000 ;; outbound) arg="/usr/spool/uucp" ; desire=2000 ;; archive) arg="$NEWSARTS" ; desire=1 ;; *) echo "$0: bad type argument \`$2'!!" >&2 exit 2 ;; esac req=`expr \( $1 + $dfunit - 1 \) / $dfunit` size=`expr \( "\`df $arg\`" : '.*: *\([0-9]*\).*' - $desire \) / $req` if [ $size -lt 0 ]; then echo 0 elif [ $size -gt 10000 ]; then echo 10000 else echo $size fi exit 0 (Note another difference: the original does the computation in terms of bytes, mine converts the numbers to dfunits and does the computation in terms of that; this is a minor difference, though one could argue that mine is the more consistent with reality.) And a third gripe: putting tab characters anywhere except at the start of a line causes lots of problems with certain editors (like mine). These editors have a nasty habit of changing the tabs into spaces or of displaying them as ^I, in either case causing difficulties. --- Bill { uunet | novavax | ankh | sunvice } !twwells!bill bill@twwells.com