[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] [PATCH] gawk: Comply with IEEE Std 1003.1
From: |
arnold |
Subject: |
Re: [bug-gawk] [PATCH] gawk: Comply with IEEE Std 1003.1 |
Date: |
Wed, 25 Jul 2018 21:41:20 -0600 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
Samy Mahmoudi <address@hidden> wrote:
> Hello,
>
> When using the option -v *assignment*, POSIX awk "shall ensure
> that the assignment argument is in the same form as an assignment
> operand", in which "the characters following the equal sign shall
> be interpreted as ... a *STRING* token".
>
> Moreover, lexical conventions demand that the *STRING* token "shall
> represent a string constant" in which "a <newline> shall not occur".
>
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html
>
> Best regards,
> Samy Mahmoudi
Thanks for the pointer and the patch. Unfortunately, your code
doesn't quite match what Brian's awk does, since \-<newline> is
allowed inside strings:
$ nawk -v x='abc\
> def' 'BEGIN { print x }'
abc
def
I will look into adapting your patch to match his code. nawk and gawk
are less picky about newlines.
Thanks
Arnold