Newsgroups: news.software.b Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Minor problems with C news Message-ID: <1989Jun23.193547.1641@utzoo.uucp> Organization: U of Toronto Zoology References: <1989Jun22.061942.1751@twwells.com> Date: Fri, 23 Jun 89 19:35:47 GMT In article <1989Jun22.061942.1751@twwells.com> bill@twwells.com (T. William Wells) writes: >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. This is a bug in your system. Makefile command lines are supposed to be run AS IF by the shell. The best fix, probably, is a /bin/test with functionality matching that of the builtin. >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... The former is a System V bug; they broke the -s option of grep. The latter is indeed our fault. The official patch just released fixes both. >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... This is a difference in "find" behavior that we overlooked; the ones we have don't do that. Fixed in the patch. >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... Arguably a bug; doexpire perhaps should take the file name as an argument. Just modify it. (See why all that upper-level control is shell files?) >Another gripe: I understand using shell scripts all over the place, >though they really slow some things down... The only thing we're aware of that is seriously hurt by being a shell file is inews (which we're reluctant to do in C because so much of it is potentially subject to change to enforce local policies). Most everything else just uses the shell files for outermost-level control, with the real work all being done in C. (The batcher, for example, is totally dominated by the batchmake|compress|uux pipeline, 100% C.) >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... Awk is indeed a bit slow. However, it wins big on flexibility and portability. Expr does only 16-bit arithmetic on 16-bit machines, for example, while awk copes properly. >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. We do not think it is our responsibility to fix bugs in your editors. Mid-line tabs are common in C source and shell files everywhere. -- NASA is to spaceflight as the | Henry Spencer at U of Toronto Zoology US government is to freedom. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu