Path: utzoo!news-server.csri.toronto.edu!rutgers!ukma!seismo!uunet!sunquest!charon.sunquest.com!jew From: jew@charon.sunquest.com (James E. Ward) Newsgroups: comp.unix.questions Subject: Re: awk >> operator Message-ID: <15829@sunquest.UUCP> Date: 14 Mar 91 15:09:56 GMT References: <15807@sunquest.UUCP> Sender: news@sunquest.UUCP Organization: Sunquest Information Systems, Tucson Lines: 17 I figured it out last night. The problem was that the first line of the input file did not define the Output variable, so awk didn't know where to send it's output. Thanks if you tried to help! Final Program: #!/bin/sh # # awk 'BEGIN { Output="/dev/null" } { if ($0 ~ "^IXXPS2-") Output=$1 print >>Output }'