On Thursday, March 26, 2015 at 9:52:30 AM UTC-4, Kenny McCormack wrote:
> When you use the "include" mechanism - either via the "-i" command line
> option or via "@include" in the code - is their protection against the same
> file being included twice?
>
> I think there is such protection - but want confirmation.
> Also, is it in the docu?
Yes and yes.
https://www.gnu.org/software/gawk/manual/html_node/Options.html#Options
-i source-file
--include source-file
Read awk source library from source-file. This option is completely equivalent to using the '@include' directive inside your program. This option is very similar to the -f option, but there are two important differences. First, when -i is used, the program source will not be loaded if it has been previously loaded, whereas the -f will always load the file. Second, because this option is intended to be used with code libraries, gawk does not recognize such files as constituting main program input. Thus, after processing an -i argument, gawk still expects to find the main source code via the -f option or on the command-line.