Bug 128345
| Summary: | gawk: "str1 str2 | getline" no longer concatenates str1 str2 | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | George Hansper <georgeh> |
| Component: | gawk | Assignee: | Thomas Woerner <twoerner> |
| Status: | CLOSED NOTABUG | QA Contact: | Brock Organ <borgan> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 2 | CC: | mitr |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | i386 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2004-08-06 11:33:15 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
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. |
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.