awk vs. regular expressions starting with equal sign

Jonathan Biggar jonab at sdcrdcf.UUCP
Fri Dec 14 06:21:31 AEST 1984


In article <4770 at utzoo.UUCP> henry at utzoo.UUCP (Henry Spencer) writes:
>There is a fundamental lexical ambiguity in awk:  when you see "/=",
>is this the divide-by-and-assign operator, or the start of a regular
>expression which happens to begin with an equal sign?  Awk thinks it
>is the operator, which means you can't start a regular expression with
>an equal sign, ever.  To really write such a pattern, you have to resort
>to schemes like "/.=/" or "/.*=/".  How annoying.  I can see no real fix.

You should use "/[=]/", it is better.

Jon Biggar
{allegra,burdvax,cbosgd,hplabs,ihnp4,sdccsu3}!sdcrdcf!jonab



More information about the Comp.unix.wizards mailing list