awk vs. regular expressions starting with equal sign

Henry Spencer henry at utzoo.UUCP
Fri Dec 21 04:32:47 AEST 1984


>     1.  It was not clear from your orginal posting that you knew that there
>     	was a work-around...

If you re-read my original posting, you'll see explicit mention of using
things like /.*=/ as workarounds.  Not as nice as /\=/ or /[=]/, but
definitely the same sort of animal.

>    2.  Your quest for a fix implies that there is a problem.  That I'm not
>   	so sure about.  Both C expression syntax and regular expression
>	syntax are consistent in isolation from each other, and the conflict
>	arises only in their concerted application.  The ambiguity is a 
>	syntactic one that would require an irregularity in either regular
>	expressions or arithmetic expressions to resolve it.  Better that
>	they should remain pure, and the conflicts of their mutual
>	application be documented rather than coming up with yet another
>	mechanism, one more exception that must be remembered.

Sure there's a problem.  A perfectly legitimate, valid regular expression
won't work.  (It does not help that awk gives an extremely cryptic message,
and that the problem is not documented anywhere.)  There is no fundamental
ambiguity here, because the two occur in different contexts.  Note that awk
does *not* get confused about whether "/" is a division operator or the
starting delimiter of a regular expression.  It really ought to be doing
the same for "/=".  Upon close examination of the awk source, I suspect
that this is not too hard.  I may have a try at a fix; stay tuned.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.unix.wizards mailing list