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:26:29 +0200

On Sun, 3 Oct 2021 11:02:21 -0500, Ed Morton <mortoneccc@comcast.net> wrote:

> but look what happens when I populate `ARGV[]` from the input:
> 
>     $ printf './%s\n' a=b file1 |
>     awk 'NR==FNR{ARGV[ARGC++]=$0; next} FNR==1{for (i=1;i<ARGC;i++)
>     printf "ARGV[%d]=%s\n", i, ARGV[i]; print ""} {print FILENAME, $0}'
>     ARGV[1]=./a=b
>     ARGV[2]=./file1
> 
>     ./file1 1         <<< NOTE: the a=b contents are missing above this
> line ./file1 2
>     ./file1 3
> 
> The file `a=b` is ignored despite being stored in `ARGV[]` as `./a=b` 
> just like if it was one of the arguments or populated manually in BEGIN.

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

-- 
D.



reply via email to

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