Path: utzoo!utstat!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!uhccux!munnari.oz.au!murtoa.cs.mu.oz.au!ditmela!yarra!melba.bby.oz.au!leo!gnb From: gnb@bby.oz (Gregory N. Bond) Newsgroups: news.software.b Subject: Re: C news: file ownership and running build 47386 times Message-ID: Date: 20 Nov 89 04:29:16 GMT References: <3054@splut.conmicro.com> Sender: news@melba.bby.oz.au Organization: Burdett, Buckeridge and Young Ltd. Lines: 52 In-Reply-To: jay@splut.conmicro.com's message of 18 Nov 89 14:17:08 GMT In article <3054@splut.conmicro.com> jay@splut.conmicro.com (Jay "you ignorant splut!" Maynard) writes: On top of all this, I've lost count of the times I've had to abort build because I forgot to tell it that I don't have mkdir(), or that my chown is /bin/chown, or... Can't build be set up to remember what it did last time? (Yes, Henry, I'll make the changes if you'd like.) Well, the n-thousandth time I ran build, I hacked in a new feature: a shell function for read (yes, I know, non-portable) that, given stdin from a tty just did a read, otherwise did an echo and a line number. You can the say tee input | ./build first time round, and from then on ./build < input The line numbers in the output from build help in correcting the mistakes in the input file. Yes. This is ugly. Insert near the top of build: if test -t 0 ; then read=read else read=my_read lineno=0 my_read () { read inp lineno=`expr $lineno + 1` echo $inp " [line $lineno]" eval $1='"$inp"' } fi Then replace all occurences of /^[ \t]*read/ with $read. When run, it gives an output like: What user id should be used for news files [news]? news [line 1] What group id should be used for news files [news]? news [line 2] What user id should be used for news programs [bin]? bin [line 3] What group id should be used for news programs [bin]? staff [line 4] Do the C News sources belong to bin [yes]? y [line 5] You can fire up vi (unless you spilled jelly on the keyboard!) and edit the input file until it works. Henry, have you considered using lwall's configure suite? -- Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia Internet: gnb@melba.bby.oz.au non-MX: gnb%melba.bby.oz@uunet.uu.net Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb