Debian Codegraph @

test/argarray.awk

raw
1 BEGIN {
2 argn = " argument" (ARGC > 1 ? "s" : "")
3 are = ARGC > 1 ? "are" : "is"
4 print "here we have " ARGC argn
5 print "which " are
6 for (x = 0; x < ARGC; x++)
7 print "\t", ARGV[x]
8 print "Environment variable TEST=" ENVIRON["TEST"]
9 print "and the current input file is called \"" FILENAME "\""
10 }
11
12 FNR == 1 {
13 print "in main loop, this input file is known as \"" FILENAME "\""
14 }