🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #548

Re: calendar preprocesses its input a bit too much

#548
From: simon
Date: Tue, 10 Feb 1987 14:59
44 lines
2242 bytes
In article <6458@allegra.UUCP> mp@allegra.UUCP (Mark Plotnick) writes:
>If you prefer that calendar not change lines like
>	jan 28 1:30 1D451 pipelined design of a fast vax - Doug Clark from DEC
>into
>	jan 28 1:30 1D451 pipelined design of a fast 1 - Doug Clark from DEC
>then try this:
>RCS file: calendar.sh,v
>diff  -r1.1 -r1.2
>< 	(/lib/cpp calendar | egrep -f $tmp);;
>---
>> 	(/lib/cpp -Uvax -Uunix -Usun -Umc68000 -Umc68010 -Umc68020 calendar | egrep -f $tmp);;
>	Mark Plotnick
>	allegra!mp

Mmmm, yes, well... Is this not just a little bit inflexible? How about something
gross and ugly (and in the true Un+x tradition :-}) like:
	(trueinum=`ls -i /bin/true | awk '{print $1}'`;
	 exclude=`ls -i /bin -inum $trueinum -print \
			| awk '{print $2}' \
			| xargs basename \
			| awk '{print "-U"$1}';
	 /lib/cpp $exclude calendar | egrep -f $tmp);;
	 .
	 .
	 .
(ie, exclude all those names which are linked to /bin/true in /bin - such as
/bin/{pdp11,vax,sel,sun,GEC,....}).
Unfortunately, this only gets the machine name, not the processor name, so
things like mc680[012]0 need to be wiped out some other way. Its a pity that
BSD doesn't have uname(1) :-)

In fact, it should probably be *really* done with double-nested "eval"
statements, with the suitable {sex,quad,bi}ruple-backslash quoting stuff
instead of cheating and using all those nasty temporary variables!

:-) :-) :-)

Simon

-----
Simon Brown
Dept. of Computer Science, University of Edinburgh, Scotland, UK.
UUCP: ...!mcvax!ukc!{cstvax,its63b}!simon
JANET: simon@uk.ac.ed.{its63b,cstvax}
Technical Details
Message-ID: <251@its63b.ed.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!brl-adm!seismo!mcvax!ukc!its63b!simon
References: <6458@allegra.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!brl-adm!seismo!mcvax!ukc!its63b!simon
From: simon@its63b.UUCP
Newsgroups: comp.bugs.4bsd
Subject: Re: calendar preprocesses its input a bit too much
Message-ID: <251@its63b.ed.ac.uk>
Date: Tue, 10-Feb-87 09:59:44 EST
Article-I.D.: its63b.251
Posted: Tue Feb 10 09:59:44 1987
Date-Received: Thu, 12-Feb-87 00:23:49 EST
References: <6458@allegra.UUCP>
Reply-To: simon@its63b.ed.ac.uk (Simon Brown)
Organization: I.T. School, Univ. of Edinburgh, U.K.
Lines: 44
Summary: cpp is very very sick (see also comp.lang.c!!)