Subject: Re: problem with NetBSD awk
To: None <tlaronde@polynum.com>
From: Aleksey Cheusov <cheusov@tut.by>
List: tech-userlevel
Date: 04/22/2006 22:47:13
> On Sat, Apr 22, 2006 at 09:42:27PM +0300, Aleksey Cheusov wrote:
 >> 
 >> > So, regarding NetBSD version of awk (nawk), it is posix compliant one
 >> > (regarding this) while others seem not.

 >> Very strange conslusion.
 >> In above paragraph, there is nothing about [:cntrl:]
 >> characters. While passing to -v all they should remain unchanged.
 >> IMO -v option should work this way. Otherwise passing -v to
 >> awk will be rounded with lots of annoying tr.

> Well, do we agree with :

> 1) the printf(1) assigns expanded newlines to nls :

> $ printf 'a\nb\n'
> a
> b
true

> 2) so awk(1) receives an assignment to nls with newlines (not escaped
> sequences) in it;
true

> 3) this is a string constant assigned to a variable ;
true
> 3) the quote from susv3 says that :
> 	[..]A <newline> shall not occur within a string constant.[...]
> What have I missed ?
Another important quotation from _assignment_ declaration ;)

The characters following the equal 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...

Seriously, you are absolutely right.
Here we have yet another stupid standard. :(

Thanks for the explanation.

-- 
Best regards, Aleksey Cheusov.