summaryrefslogtreecommitdiffstats
path: root/contrib/awk/test/argarray.awk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/awk/test/argarray.awk')
-rw-r--r--contrib/awk/test/argarray.awk14
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/awk/test/argarray.awk b/contrib/awk/test/argarray.awk
new file mode 100644
index 0000000..1960f9bd
--- /dev/null
+++ b/contrib/awk/test/argarray.awk
@@ -0,0 +1,14 @@
+BEGIN {
+ argn = " argument" (ARGC > 1 ? "s" : "")
+ are = ARGC > 1 ? "are" : "is"
+ print "here we have " ARGC argn
+ print "which " are
+ for (x = 0; x < ARGC; x++)
+ print "\t", ARGV[x]
+ print "Environment variable TEST=" ENVIRON["TEST"]
+ print "and the current input file is called \"" FILENAME "\""
+}
+
+FNR == 1 {
+ print "in main loop, this input file is known as \"" FILENAME "\""
+}
OpenPOWER on IntegriCloud