bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: might be a bug in gawk


From: Andreas Schwab
Subject: Re: might be a bug in gawk
Date: Wed, 25 Mar 2009 18:36:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux)

Dave B <address@hidden> writes:

> Andrew J. Schorr wrote:
>> On Tue, Mar 24, 2009 at 11:58:29PM -0400, joanes.polus wrote:
>>>    execution of:
>>>
>>>    echo "a%28b%29%c"|awk -F "a" '{printf $2}'
>>>
>>>    give this result:
>>>
>>>    %28b%c
>>>
>>>    and not
>>>
>>>    %28b%29%c
>>>
>>>    So may be a bug or i do not understand something in awk.
>> 
>> Try using "print" instead of "printf" and you should get
>> the desired result.
>
> Agreed. However, I'd still expect to get a "not enough arguments to printf"
> kind of error, which is not produced (whereas mawk and Bell labs awk do
> complain if asked to run the OP's code).

There is no formatting directive that reqires an argument.  %28b is
unknown and %29% is treated the same as %%.  Perhaps mawk assigns a
meaning to %b.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]