Path: utzoo!attcan!uunet!wuarchive!psuvax1!rutgers!mit-eddie!uw-beaver!uw-june!ka From: ka@cs.washington.edu (Kenneth Almquist) Newsgroups: comp.unix.wizards Subject: Re: Awk oddity Message-ID: <9342@june.cs.washington.edu> Date: 2 Oct 89 05:15:18 GMT References: <9150@elsie.UUCP> Organization: U of Washington, Computer Science, Seattle Lines: 18 > 2. Write and test an awk script to print all input lines that contain > the character '='. If you write awk '/=/' awk will think that the sequence "/=" is an operator rather than the start of a regular expression. You can avoid this by writing awk '/\=/' Or you can patch awk to handle this case. (Look at the grammar rule that matches a regular expression. This handles a "/" operator. Add an alternative to handle the "/=" operator, which should be similar except that it should do a "yyunput('=');" to cause the equals sign treated as part of the regular expression.) Kenneth Almquist