PolyAwk - AWK question

Jonathan I. Kamens jik at athena.mit.edu
Thu May 4 11:11:16 AEST 1989


In article <17886 at cup.portal.com> MJB at 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 at Athena.MIT.EDU				Cambridge, MA 02139-4318
Office: 617-253-4261			      Home: 617-225-8218



More information about the Comp.unix.questions mailing list