Bug 174040 - BEGINFILE/ENDFILE extension to gawk
Summary: BEGINFILE/ENDFILE extension to gawk
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: gawk
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-11-24 00:13 UTC by JW
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-11-24 07:41:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch adds BEGINFILE and ENDFILE statement blocks (6.96 KB, patch)
2005-11-24 00:15 UTC, JW
no flags Details | Diff

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?



Note You need to log in before you can comment on or make changes to this bug.