From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ditsydh.syd.dit.csiro.au ([130.155.128.18]) by archone.tamu.edu with SMTP id <22531>; Fri, 23 Aug 1991 19:32:40 -0500 Received: by ditsydh.syd.dit.csiro.au id AA04318 (5.64+/IDA/DIT-0.9 for rc@archone.tamu.edu); Sat, 24 Aug 91 10:32:24 +1000 From: John Mackin Date: Fri, 23 Aug 1991 19:15:43 -0500 To: The rc Mailing List Subject: Re: early reaction(s) to rc In-Reply-To: <9108231647.AA01674@skeeve.ATL.GA.US> Message-Id: <9108241015.914.rc.bafoy@syd.dit.csiro.au> X-Face: 39seV7n\`#asqOFdx#oj/Uz*lseO_1n9n7rQS;~ve\e`&Z},nU1+>0X^>mg&M.^X$[ez>{F k5[Ah<7xBWF-@-ru?& @4K4-b`ydd^`(n%Z{ Arnold writes, in relation to rcmain: I would love to know how this works. -c is trivial: eval $*(2) ; exit and so is -l, but -p and -i are harder --- is there some secret equivalent of `set' in his rc? In other words, how does the rc program tell the shell itself what to do with the environment and whether or not to prompt? I second the first comment; for quite a while I've wanted to have a look at a real Tenth Edition (as opposed to Plan 9, if there is a difference) rcmain. Boyd, do you reckon if you ask td to mail you one, he will? I have some general comments to make about rcmain which I will send later today, right now I have to get off to work -- but I just thought I should point out that -p doesn't require any support beyond what our rc already has: eval `{ whatis | rev | sed -n -e '/ nf$/s/^.*{\(.*\)$/\1/p' | rev } You can't really do without the two rev's, since there's no way to be sure your r.e. is matching the function name correctly if you try that (consider that function names, if quoted, may contain both space and left-curly-bracket). But that certainly does the job of removing functions from the environment. (Of course, in a real rcmain, all the commands above -- eval, whatis, rev, sed, and rev -- would be prefixed by `builtin' to avoid being subverted by functions before they could accomplish the task of deleting them. I have omitted this here for clarity.) OK, John.