Xref: utzoo comp.unix.questions:13236 comp.sys.ibm.pc:28268 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!apple!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions,comp.sys.ibm.pc Subject: Re: PolyAwk - AWK question Message-ID: <11085@bloom-beacon.MIT.EDU> Date: 4 May 89 01:11:16 GMT References: <17886@cup.portal.com> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 23 In article <17886@cup.portal.com> MJB@cup.portal.com (Martin J Brown-Jr) writes: >[He asks why this works: > > awk '$0 !~ /Command:*/ { print $0 >"d:foo" }' > >while this doesn't: > > awk '$0 !~ /Command:*/ { print $0 >"d:foo" } "d:file.txt"' >] What you really mean to do is this: awk '$0 !~ /Command:*/ { print $0 >"d:foo" }' d:file.txt Since you included the filename inside the single quotes, awk thought it was part of the awk command sequence. This way, it will be passed to awk as a separate argument as it should. Jonathan Kamens USnail: MIT Project Athena 410 Memorial Drive, No. 223F jik@Athena.MIT.EDU Cambridge, MA 02139-4318 Office: 617-253-4261 Home: 617-225-8218