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

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

Problem with changed 'pipe' precedence


From: jw203197
Subject: Problem with changed 'pipe' precedence
Date: Sun, 27 Nov 2005 15:49:31 +1100

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





reply via email to

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