Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with changed 'pipe' precedence

0 views
Skip to first unread message

jw20...@loftmail.com

unread,
Nov 26, 2005, 11:49:31 PM11/26/05
to bug-...@gnu.org
Recent versions of gawk (at least 3.1.4-5.3) seem to have taken
the considerable liberty of changing the precedence order of the
pipe-like operator '|' (with getline) wrt string concatentation.

Previously, and in all other versions of awk I have ever encountered,
the following worked sensibly:

"date " "+%Z" | getline zone

That is, string concatenation has higher precedence than '|'.
In fact string concatentation

Now, for some very obscure reason (if any), the above has effectively
changed to:

"date " ("+%Z" | getline zone)

Ouch! This breaks so many scripts!

Worse still, the above statement doesn't even evaluate to anything
particularly sensible. In fact, it is quite meaningless.

Look to me as though some person has lamely used bitwise '|' operator
precendence rules and drawn a very wrong conclusion as to what '|'
means in the above context. It is esentially a string operation and
not an arithmetic one.

Please, can somebody fix this piece of stupidity?

Regards
John Witford

Bob Proulx

unread,
Nov 28, 2005, 10:37:38 AM11/28/05
to jw20...@loftmail.com, bug-...@gnu.org
jw20...@loftmail.com wrote:
> Recent versions of gawk (at least 3.1.4-5.3) seem to have taken
> the considerable liberty of changing the precedence order of the
> pipe-like operator '|' (with getline) wrt string concatentation.

Please see this thread of discussion on this topic.

http://lists.gnu.org/archive/html/bug-gnu-utils/2005-10/msg00064.html

The thread was broken but continues here.

http://lists.gnu.org/archive/html/bug-gnu-utils/2005-10/msg00086.html

> Please, can somebody fix this piece of stupidity?

> ...other similar derisive remarks deleted...

Note that the tone of your message is not conducive to starting a
productive conversation with a developer. In the future you would be
well advised to remember the old saying, "You catch more flies with
honey than vineger."

Bob


Aharon Robbins

unread,
Nov 29, 2005, 2:58:13 PM11/29/05
to b...@proulx.com, jw20...@loftmail.com, bug-...@gnu.org
Bob's comments are on target. In particular his note about the tone
of the original post is correct; I didn't particularly appreciate it.
Would you say such things if you were talking to me in person? I
rather doubt it...

Arnold

> Date: Mon, 28 Nov 2005 08:37:38 -0700
> From: b...@proulx.com (Bob Proulx)
> Subject: Re: Problem with changed 'pipe' precedence
> To: jw20...@loftmail.com
> Cc: bug-...@gnu.org

Aharon Robbins

unread,
Nov 30, 2005, 11:18:15 AM11/30/05
to arn...@skeeve.com, b...@proulx.com, jw20...@loftmail.com, bug-gn...@gnu.org
Thank you for clarifying these issues for me.

You may wish to use a different awk implementation, such as the Bell Labs
awk, or mawk. URLs for both are listed in the gawk documentation.

You may also wish to parenthesize your string concatenations when used
with getline. This will insure portability to all awk implementations.

Arnold Robbins

> Date: Wed, 30 Nov 2005 09:59:17 +1100
> From: jw20...@loftmail.com


> Subject: Re: Problem with changed 'pipe' precedence

> To: arn...@skeeve.com, b...@proulx.com
>
> For goodness me! Why don't you all grow up and start acting
> like adults instead of little wee hurt children.
>
> You didn't adequately test your changes and made a serious
> blunder, then you get all precious about it when somebody
> gets pissed off with the havoc the blunder caused.
>
> Last time the steering pinion in my car broke I also
> got really pissed off and complained to the manufacturer.
> And I wasn't polite about it either. Would you be?
>
> I suggest you develop some quality control for your product.
>
> Have a nice day.
> JW

> #####################################################################################
> This Mail Was Scanned by 012.net AntiVirus Service1- Powered by TrendMicro Interscan
>


Eli Zaretskii

unread,
Nov 30, 2005, 4:35:59 PM11/30/05
to Aharon Robbins, jw20...@loftmail.com, bug-gn...@gnu.org, b...@proulx.com
> Date: Wed, 30 Nov 2005 09:59:17 +1100
> From: jw20...@loftmail.com
> Subject: Re: Problem with changed 'pipe' precedence
> To: arn...@skeeve.com, b...@proulx.com
>
> For goodness me! Why don't you all grow up and start acting
> like adults instead of little wee hurt children.
>
> You didn't adequately test your changes and made a serious
> blunder, then you get all precious about it when somebody
> gets pissed off with the havoc the blunder caused.

Arnold, there's no need to bother talking to this stupid prick. He
doesn't really know what he is talking about; it's like teaching
calculus to a 5-year toddler. He thinks that if he picked up some bad
language from nearby working girls, he knows enough to talk to
grownups.

> Have a nice day.

We will, as soon as we forget we ever heard you.


0 new messages