Subject: Re: problem with NetBSD awk
To: None <>
From: Aleksey Cheusov <>
List: tech-userlevel
Date: 04/22/2006 21:42:27
 >> 0 ~>/usr/bin/awk -v nls="`printf 'a\nb\n'`" 'BEGIN { print nls }'
 >> /usr/bin/awk: newline in string a
 >> b... at source line 1
 >> 2 ~>
 >> All three awk implementation works the same way with the following command
 >> /usr/bin/awk -v nls='a\nb\n' 'BEGIN { print nls }'
 >> susv3 says the following

> The fact that the second version works is normal,
Agree. This case is just easier to explain ;)

> since in susv3 (IMHO
> you didn't quote the relevant part :
My quote was correct but incomplete.
My question was _NOT_ about -v a="a\nb\n"

> 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.

Best regards, Aleksey Cheusov.