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>; Sat, 24 Aug 1991 10:26:24 -0500 Received: by ditsydh.syd.dit.csiro.au id AA18983 (5.64+/IDA/DIT-0.9 for rc@archone.tamu.edu); Sun, 25 Aug 91 01:26:05 +1000 From: John Mackin Date: Sat, 24 Aug 1991 10:10:33 -0500 Actual-Date: Sun, 25 Aug 91 01:10:33 +1000 To: The rc Mailing List Subject: Severe egg on face References: <9108241348.26582.rc.bafub@syd.dit.csiro.au> Message-Id: <9108250110.16085.rc.bafup@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{ _This_ time, I wrote: - 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!) Heavy sighing is about all I can manage at this stage. Of course, this breaks in the simple degenerate case of a function named '. I'm now pretty certain (although having been this stupid, I don't feel too certain about anything :() that this can't be done with grep-style regular expressions, and therefore can't be done with sed. If anyone is interested in following that up, do let me know if you succeed: the problem is that when you match a ', it's not a terminator if it was preceded by [^']', but is one if it was preceded by '' or [^'], and I don't think it's possible to express that in a grep RE. I _believe_ it can be done with an egrep RE, and therefore the task can be accomplished with awk -- but I am by no means prepared to assert that definitely. (Being wrong does terrible things to my self-confidence.) As a sop, I'm prepared to offer the thought that all this doesn't matter that much, since the purpose of getting rid of functions with -p is to prevent people `surprising' your script, and for that purpose, functions with quoted names aren't going to matter and could be ignored (and left in the environment). This is by no means _right_, though. If it can't be done with awk, the solution is to code it up in C... OK, John.