When I run "gawk" with no parameters, I get:
(Note: gawk version is 4.1.1; I get the same results with 4.1.4)
$ gawk
Usage: gawk [POSIX or GNU style options] -f progfile [--] file ...
Usage: gawk [POSIX or GNU style options] [--] 'program' file ...
POSIX options: GNU long options: (standard)
-f progfile --file=progfile
-F fs --field-separator=fs
-v var=val --assign=var=val
Short options: GNU long options: (extensions)
-b --characters-as-bytes
-c --traditional
-C --copyright
-d[file] --dump-variables[=file]
-D[file] --debug[=file]
-e 'program-text' --source='program-text'
-E file --exec=file
-g --gen-pot
-h --help
-i includefile --include=includefile
-l library --load=library
-L [fatal] --lint[=fatal]
-n --non-decimal-data
-M --bignum
-N --use-lc-numeric
-o[file] --pretty-print[=file]
-O --optimize
-p[file] --profile[=file]
-P --posix
-r --re-interval
-S --sandbox
-t --lint-old
-V --version
To report bugs, see node `Bugs' in `
gawk.info', which is
section `Reporting Problems and Bugs' in the printed version.
gawk is a pattern scanning and processing language.
By default it reads standard input and writes standard output.
Examples:
gawk '{ sum += $1 }; END { print sum }' file
gawk -F: '{ print $1 }' /etc/passwd
$
I draw your attention to the line that contains "-L" (uppercase L) and
implies that that is equivalent to --lint. I generally prefer to use the
short options - easier to type.
However, when I do:
$ gawk -L -f SomeScript NotAFile
gawk: fatal: cannot open file `NotAFile' for reading (No such file or
directory)
But the same thing with --lint instead of -L works as expected.
(I.e., runs the program as expected, and generates (lots of) lint warnings)
Note that SomeScript is a script that examines and then discards ARGV[1],
so the fact that that name does not reference a file is not an issue.
--
In politics and in life, ignorance is not a virtue.
-- Barack Obama --