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

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

Re: [gawk] Change in the order of precedence for the redirection operato


From: Karel Zak
Subject: Re: [gawk] Change in the order of precedence for the redirection operator?
Date: Thu, 01 Dec 2005 11:14:53 +0100

On Thu, 2005-10-27 at 10:53 +0200, Stepan Kasal wrote:
> Hello,
> 
> > > gawk 'BEGIN { "echo " "date" | getline;  print }'
> 
> as I supposed, this incompatibility was introduced by my patches, which fixed
> other bugs in the parser.
> 
> I wrote two patches; please apply gawk-20051027-pars1.patch first, and
> then gawk-20051027-pars2.patch .
> 
> gawk-20051027-pars2.patch fixes the bug quoted above.
> 
> gawk-20051027-pars1.patch is a small cleanup of the grammar, which prepares
> it for the other patch.  Moreover, it fixes a bug that some expressions
> were not parsed correctly; see the new test file for details.
> 
> Arnold, will you accept these patches?

You should fix docs too. There is:

http://www.gnu.org/software/gawk/manual/html_node/Getline_002fPipe.html#Getline_002fPipe

According to POSIX, `expression | getline' is ambiguous if expression contains
unparenthesized operators other than `$'—for example, `"echo " "date" | getline'
                                                        ^^^^^^^^^^^^^^^^^^^^^^
is ambiguous because the concatenation operator is not parenthesized. You should
^^^^^^^^^^^^
write it as `("echo " "date") | getline' if you want your program to be portable
to other awk implementations. 


        Karel

-- 
Karel Zak <address@hidden>





reply via email to

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