Bug 174040

Summary: BEGINFILE/ENDFILE extension to gawk
Product: [Fedora] Fedora Reporter: JW <ohtmvyyn>
Component: gawkAssignee: Karel Zak <kzak>
Status: CLOSED WONTFIX QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-11-24 07:41:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch adds BEGINFILE and ENDFILE statement blocks none

Description JW 2005-11-24 00:13:51 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; MSIE 6.0; Windows; U; AIIEEEE!; Win98; Windows 98; en-US; Gecko masquerading as IE; should it matter?; rv:1.8b) Gecko/20050217

Description of problem:
The following patch contains an extension to gawk adding BEGINFILE and ENDFILE blocks, much like BEGIN and END blocks.  These are really useful when processing a large number of files and variables need resetting for each file - rather than treating all files as just a single stream.


Version-Release number of selected component (if applicable):
gawk-3.1.4-5.3

How reproducible:
Always

Steps to Reproduce:
1.gawk 'BEGINFILE{sum=0;}{sum+=$1;}ENDFILE{print FILENAME,sum}' file1 file2 ...
2.
3.
  

Actual Results:  syntax error

Expected Results:  file1 100
file2 200
etc


Additional info:

Comment 1 JW 2005-11-24 00:15:08 UTC
Created attachment 121425 [details]
patch adds BEGINFILE and ENDFILE statement blocks

Comment 2 Karel Zak 2005-11-24 07:41:13 UTC
Thanks for your work, but -- please -- send your patch to upstream developers.
I'd like to keep minimal difference between upstream and RHEL/FC gawk code.

Comment 3 JW 2005-11-24 08:21:41 UTC
(In reply to comment #2)
> Thanks for your work, but -- please -- send your patch to upstream developers.
> I'd like to keep minimal difference between upstream and RHEL/FC gawk code.

Did RH do that when RH inserted all the SELINUX stuff in pam code?