Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!rpi!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.unix.shell Subject: Re: awk variables Message-ID: <2469@sixhub.UUCP> Date: 3 Dec 90 03:56:58 GMT References: <30404@boulder.Colorado.EDU> <8720009@hpdmd48.boi.hp.com> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 17 awk reads variables off the command line. They appear between the commands (or name of the command file) and the filename(s) to be processed. That means you might specify the input filename, using '-' if stdin is what you want (not all versions need this, all accept it). As: awk '$3 == BAR { print $2 }' BAR=$5 file ^^^^^^ Sets BAR in the awk environment -- bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen) sysop *IX BBS and Public Access UNIX moderator of comp.binaries.ibm.pc and 80386 mailing list "Stupidity, like virtue, is its own reward" -me