bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk skipping ./file name containing =


From: Davide Brini
Subject: Re: gawk skipping ./file name containing =
Date: Sun, 3 Oct 2021 19:41:54 +0200

On Sun, 3 Oct 2021 19:26:29 +0200, Davide Brini <dave_br@gmx.com> wrote:

> Doesn't seem to be related to the filenames though, I see the same output
> with a file named "foo":
>
> $ cat foo
> here
>
> $ cat file1
> 1
> 2
> 3
>
> $ printf './%s\n' foo file1 | awk 'NR==FNR{ARGV[ARGC++]=$0; next} {print
> FILENAME, $0}'
> ./file1 1
> ./file1 2
> ./file1 3
>

This seems to work though, not sure it's as expected or we're hitting a dark
corner here:

$ printf './%s\n' foo file1 | awk '
BEGIN{ARGV[ARGC++]="-"}
NR==FNR{ARGV[ARGC++]=$0; next}
{print FILENAME, $0}'
./foo here
./file1 1
./file1 2
./file1 3

--
D.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]