From bacon@smithers.neuro.mcw.edu  Sun Mar  7 09:39:31 2004
Return-Path: <bacon@smithers.neuro.mcw.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 18A7116A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Mar 2004 09:39:31 -0800 (PST)
Received: from smithers.neuro.mcw.edu (smithers.neuro.mcw.edu [141.106.106.66])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C602043D41
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Mar 2004 09:39:30 -0800 (PST)
	(envelope-from bacon@smithers.neuro.mcw.edu)
Received: from smithers.neuro.mcw.edu (localhost [127.0.0.1])
	by smithers.neuro.mcw.edu (8.12.9/8.12.9) with ESMTP id i27HdT8f025087
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 7 Mar 2004 11:39:29 -0600 (CST)
	(envelope-from bacon@smithers.neuro.mcw.edu)
Received: (from bacon@localhost)
	by smithers.neuro.mcw.edu (8.12.9/8.12.9/Submit) id i27HdT7o025086;
	Sun, 7 Mar 2004 11:39:29 -0600 (CST)
Message-Id: <200403071739.i27HdT7o025086@smithers.neuro.mcw.edu>
Date: Sun, 7 Mar 2004 11:39:29 -0600 (CST)
From: Jason Bacon <bacon@smithers.neuro.mcw.edu>
Reply-To: Jason Bacon <bacon@smithers.neuro.mcw.edu>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: print redirection broken in awk
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         63886
>Category:       bin
>Synopsis:       print redirection broken in awk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 07 09:40:13 PST 2004
>Closed-Date:    Sat Apr 24 00:58:12 PDT 2004
>Last-Modified:  Sat Apr 24 00:58:12 PDT 2004
>Originator:     Jason Bacon
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
Medical College of Wisconsin
>Environment:
System: FreeBSD smithers.neuro.mcw.edu 5.1-RELEASE FreeBSD 5.1-RELEASE #1: Thu Feb 19 13:09:05 CST 2004 bacon@smithers.neuro.mcw.edu:/usr/obj/usr/src/sys/smithers i386


>Description:
	The print command within /usr/bin/awk under FreeBSD 5.x no 
	longer accepts concatenated strings for filenames after the 
	redirection symbol '>'.

	For example: 

		awk ' { print "hello" > FILENAME"."NR }' file

	produces the error:

		awk: syntax error at source line 1
 		context is
         		{ print "sadfsad" > >>>  FILENAME"." <<< 
		awk: illegal statement at source line 1

	The same error does not occur under FreeBSD 4.9, or with gawk.

	Parenthesizing the filename eliminates this error, but instead
	produces another:

		awk ' { print "sadfsad" > (FILENAME"."NR) }' filename

		awk: filename.18 makes too many open files
		 input record number 18, file filename
		 source line number 1

>How-To-Repeat:

        awk ' { print "hello" > FILENAME"."NR }' file

>Fix:

	Workaround: use gawk
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Sat Apr 24 00:57:28 PDT 2004 
State-Changed-Why:  
Please take this up with the awk developers; FreeBSD does not separately 
develop this software. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63886 
>Unformatted:
