Xref: utzoo comp.unix.questions:13425 comp.sys.ibm.pc:28543 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!ames!xanth!nic.MR.NET!hal!ncoast!allbery From: allbery@ncoast.ORG (Brandon S. Allbery) Newsgroups: comp.unix.questions,comp.sys.ibm.pc Subject: Re: PolyAwk - AWK question Message-ID: <13635@ncoast.ORG> Date: 10 May 89 00:11:56 GMT References: <17886@cup.portal.com> Reply-To: allbery@ncoast.UUCP (Brandon S. Allbery) Followup-To: comp.unix.questions Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 21 As quoted from <17886@cup.portal.com> by MJB@cup.portal.com (Martin J Brown-Jr): +--------------- | awk '$0 !~ /Command:*/ { print $0 >"d:foo" } "d:file.txt"' +--------------- Was this the *exact* quoting? By putting the file name inside the single quotes, you made it part of the awk program, *not* an input filename. The result is that it's reading from the keyboard so it can copy lines not containing "Command" (if this isn't what you wanted, check that regexp!) to "d:foo", and also attempting to apply the string "d:file.txt" as a condition. That last might be handled either as a test for string equality against $0, or as an always "true" depending on how they did it. ++Brandon -- Brandon S. Allbery, moderator of comp.sources.misc allbery@ncoast.org uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu Send comp.sources.misc submissions to comp-sources-misc@ NCoast Public Access UN*X - (216) 781-6201, 300/1200/2400 baud, login: makeuser