[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Gawk feature request - file list
From: |
arnold |
Subject: |
Re: [bug-gawk] Gawk feature request - file list |
Date: |
Wed, 01 Feb 2017 07:57:18 -0700 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
Hi.
Thank you for your note.
Daniele Zanoli <address@hidden> wrote:
> Hello,
> I'm an enthusiast user of gawk. I hope this is the best address to place a
> feature request (I could not find an "official" place for requests)
>
> Often I have to use gawk on a large number of files with a single execution
> of
> gawk (I have to compare some file contents) but it is very easy to reach the
> maximum length of the shell command line, since files are in different paths
>
> So I think it would be useful (not only for me) a new command line switch to
> specify a file that contains the names of the files to process (e.g.
> gawk .. -list myfilelist.txt ...)
>
> Best regards,
>
> --
> Daniele
This doesn't require a new option; it can be done easily in awk code.
Something like the following (untested, but you'll get the idea):
BEGIN {
filelist = ARGV[1]
ARGC--
for (i = 1; (getline filename < filelist) > 0; i++) {
ARGV[i] = filename
ARGC++
}
}
should do the trick.
Hope this helps,
Arnold