[Bug 217553] [patch] awk(1) assignment arguments do not accept values with a leading '='
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun Mar 5 01:39:26 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217553
Bug ID: 217553
Summary: [patch] awk(1) assignment arguments do not accept
values with a leading '='
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Keywords: patch
Severity: Affects Some People
Priority: ---
Component: bin
Assignee: freebsd-bugs at FreeBSD.org
Reporter: kdrakehp at zoho.com
Keywords: patch
Created attachment 180522
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=180522&action=edit
Remove the second '=' check in `isclvar'.
awk(1) explicitly disallows command-line assignments where the
assignment value has a leading '='. This behavior is contrary to the
standard, which places no such restriction on assignment values.
>From the standard:
The characters following the <equals-sign> shall be interpreted
as if they appeared in the awk program preceded and followed by
a double-quote ('"') character, as a STRING token (see Grammar),
except that if the last character is an unescaped <backslash>,
it shall be interpreted as a literal <backslash> rather than as
the first character of the sequence "\"".
How to reproduce:
$ awk 'END{print var}' var='=value=' < /dev/null
awk: can't open file var==value=
source line number 1
Expected output:
=value=
$ awk -v var='=value=' 'BEGIN{print var}'
awk: invalid -v option argument: var== text
Expected output:
=value=
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list