Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Mar 2004 11:39:29 -0600 (CST)
From:      Jason Bacon <bacon@smithers.neuro.mcw.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/63886: print redirection broken in awk
Message-ID:  <200403071739.i27HdT7o025086@smithers.neuro.mcw.edu>
Resent-Message-ID: <200403071740.i27HeD65071320@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         63886
>Category:       bin
>Synopsis:       print redirection broken in awk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 07 09:40:13 PST 2004
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403071739.i27HdT7o025086>