AWK Bug: multple -f options do not work

Bernhard Fischer rep.dot.nop at gmail.com
Sat Mar 24 19:38:12 UTC 2007


On Fri, Mar 23, 2007 at 07:50:03PM +0100, Petric Frank wrote:
>Hello,
>
>On Friday 23 March 2007 11:51, Luciano Miguel Ferreira Rocha wrote:
>> On Fri, Mar 23, 2007 at 08:41:13AM +0100, Bernhard Fischer wrote:
>> > On Fri, Mar 23, 2007 at 07:56:43AM +0100, Petric Frank wrote:
>> > >Hello,
>> > >
>> > >i saw that a new release (1.5.0) is out.
>> > >
>> > >It is good to see that awk now supports multiple -v options, but i miss
>> > >multiple -f options.
>> > >
>> > >Since i am new to this mailing list i had only the chance to dig into
>> > > the archive at busybox.net. There i found the mail from Bernhard
>> > > Fischer (dd: Sat Mar 10 04:23:37 PST 2007). I think the analogous
>> > > extension for the -f option could be easy.
>> >
>> > ok. Which options are supposed to be available multiple times?
>> > Let's straighten these out at once and not for each individual option.
>>
>> Susv3: http://www.opengroup.org/onlinepubs/009695399/utilities/awk.html
>>
>> -f  progfile
>>     Specify the pathname of the file progfile containing an awk program.
>>     If multiple instances of this option are specified, the concatenation
>> of the files specified as progfile in the order specified shall be the awk
>> program. The awk program can alternatively be specified in the command line
>> as a single argument.
>>
>> -v  assignment
>>     The application shall ensure that the assignment argument is in the
>>     same form as an assignment operand. The specified variable assignment
>>     shall occur prior to executing the awk program, including the actions
>>     associated with BEGIN patterns (if any). Multiple occurrences of this
>>     option can be specified.
>
>As far as i can see both -v and -f can be used multiple times.
>
>The sequence of files given by the -f options is significant.

.. as was the order for -v, as vda pointed out.
ok, let me try to trick you into fixing this one.. :)

Go to http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/editors
select "awk.c" and the ndiff to "previous 17972".

Look at the diff.
Implement the same for -f.
Recompile, test. Repeat until it works fine for each and all normal and
obscure methods you can imagine.
Do a svn diff --diff-cmd diff -x -rdup editors/awk.c >
~/busybox.fix-awk-f-handling.01.diff and
submit that to the list with a
Subject: [PATCH, CFT] fix awk multiple -f handling




More information about the busybox mailing list