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 22:59:35 -0500 Received: by ditsydh.syd.dit.csiro.au id AA26831 (5.64+/IDA/DIT-0.9 for rc@archone.tamu.edu); Sat, 24 Aug 91 13:58:00 +1000 From: John Mackin Date: Fri, 23 Aug 1991 22:48:43 -0500 Actual-Date: Sat, 24 Aug 91 13:48:43 +1000 To: The rc Mailing List Subject: Re: early reaction(s) to rc References: <9108241015.914.rc.bafoy@syd.dit.csiro.au> Message-Id: <9108241348.26582.rc.bafub@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{ I wrote: eval `{ whatis | rev | sed -n -e '/ nf$/s/^.*{\(.*\)$/\1/p' | rev } You can't really do without the two rev's, [...] Apologies to all on the list, I must've been drunk :). Sheesh, do I feel like a silly person; the above, of course, _still_ doesn't work in the presence of function names containing {. Anyway it can be done, but I don't have time now to fully test an implementation, and rather than mail another implementation that isn't fully tested, I'll just describe how to write the sed: - any line beginning with "fn " either does or doesn't begin with "fn '" - if it doesn't, then the function name terminates at the second space character on the line - if it does, then the function name terminates at the first "'" character following the "'" character in "fn '" which is not preceded by a "'" (wow, thank Duff for rc's simple, consistent quoting rules!) And you don't need any rev's, just the sed. Hangs head in shame.... OK, John.