Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!mtecv2!msi.umn.edu!cs.umn.edu!spool.mu.edu!think.com!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!mimsy!tove.cs.umd.edu!jfo From: jfo@tove.cs.umd.edu (John F. Ormonde) Newsgroups: comp.unix.wizards Subject: AWK, while (getline ) question Message-ID: <33491@mimsy.umd.edu> Date: 24 Apr 91 19:22:27 GMT Sender: news@mimsy.umd.edu Reply-To: jfo@tove.cs.umd.edu (John F. Ormonde) Distribution: na Lines: 26 I am having trouble with what should be a simple AWK program. Does anyone see anything wrong with this: { while (getline <"test" >0) { rot[$1] = $4 printf "%s \n", rot[$1] } } is in file zzz. On a Sparc 1 running SunOS 4.1.1 % awk -f zzz awk: syntax error near line 1 awk: illegal statement near line 1 test is a text file containing frank 1 A A A brett 4 A C A tom 2 B O W This is reasonably similar to the example on pg 101 of the AWK Programmin Language book by Aho, Kernigan, and Weinberger. SO how dense am I ? -- Go Tribe! (SOMEbody has to root for them :-) John Ormonde INTERNET: jfo@cs.umd.edu UUCP: uunet!mimsy!jfo VAX/SUN SysAdmin by necessity NOT choice