From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 Description of problem: In previous releases of gawk, the getline built-in would operate, such that given: str1 str2 | getline var The strings to the left of the '|' would be concatenated BEFORE the command is executed. The version bundled with Fedora Core 2 changes this behaviour, and only the last component of the expression is executed as the command. This appears to be a change in precedence, because: ( str1 str2 ) | getline var works as expected, as does: 1 + 4 | getline var (this gives an error: "sh: line 1: 5: command not found") Version-Release number of selected component (if applicable): gawk-3.1.3-7 How reproducible: Always Steps to Reproduce: gawk 'BEGIN { "ls" " -l " "/etc/fstab" | getline test; print test};' Actual Results: sh: line 1: /etc/fstab: Permission denied Expected Results: -rw-r--r-- 1 root root 1229 Jul 21 12:12 /etc/fstab Additional info: This bug can cause existing, previously working, awk-scripts to fail. It represents a change in the precendence of evaluation of gawk expressions.
Please have a look at http://lists.gnu.org/archive/html/bug-gnu-utils/2004-07/msg00046.html > "da" "te" | getline > > This command is ambiguous, as it can be interpreted like: > > ("da" "te") | getline > or > "da" ("te" | getline) > > Older versions of gawk took the former, while 3.1.2 and newer take > the later. (Search gawk's ChangeLog file for "getline".) > POSIX documentation mentions this specific situation: it says that > the behaviour is undefined, and that you have to parenthesize. Closing as not a bug.