bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Gawk feature request - file list


From: david kerns
Subject: Re: [bug-gawk] Gawk feature request - file list
Date: Wed, 1 Feb 2017 08:08:10 -0700

wow, that's a cool trick ...

don't forget to:

close(filelist) # it is just good etiquette :)

On Wed, Feb 1, 2017 at 7:57 AM, <address@hidden> wrote:
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



reply via email to

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