Subject: Re: ./ problem with awk script
To: Chuck Swiger <>
From: Aleksey Cheusov <>
List: netbsd-users
Date: 09/09/2006 10:54:50
> On Sep 8, 2006, at 1:25 PM, Aleksey Cheusov wrote:
 >> This message is produced by gawk.
 >> For what reasons gawk package
 >> installs /usr/pkg/bin/awk file (symlink to gawk)?
 >> TODO ;-)
 >> 1) \. should be changed to [.] in awk scripts to make them more
 >> portable
 >> 2) it is _probably_ better to remove /usr/pkg/bin/awk file
 >>    from gawk package.

> Arguably, one should be listing /usr/pkg/bin later in your $PATH  than
> /usr/bin;
I prefer to do this, but I don't want to replace awk with gawk.
Why not nawk or mawk or wip/heirloom which provides 5 different
versions of awk?

> another solution would be for to use absolute
> pathnames or to set and export a more controlled version of $PATH
> which gets inherited by the commands it runs...
Agree, it's better to isolate ./ from users' PATH,
at least for native builds.

> Or, as a completely unrelated solution, one might try to persuade the
> maintainers of gawk to not nag about regex contructs that work just
> fine with the historical AWK written by Aho, whomever [1], and
> Kernighan.

This is not a solution, but a dirty hack.
SUS defines a full list of allowed escape sequences.
\. is NOT in it. It is much better to change \. to [.].
Recently (a few weeks ago) the same bug was fixed in pkgsrc by jlam AFAIR.

Best regards, Aleksey Cheusov.