Go to the first, previous, next, last section, table of contents.


Command Line Options Summary

The command line consists of options to gawk itself, the awk program text (if not supplied via the `-f' option), and values to be made available in the ARGC and ARGV predefined awk variables:

gawk [POSIX or GNU style options] -f source-file [--] file ...
gawk [POSIX or GNU style options] [--] 'program' file ...

The options that gawk accepts are:

-F fs
--field-separator fs
Use fs for the input field separator (the value of the FS predefined variable).
-f program-file
--file program-file
Read the awk program source from the file program-file, instead of from the first command line argument.
-mf NNN
-mr NNN
The `f' flag sets the maximum number of fields, and the `r' flag sets the maximum record size. These options are ignored by gawk, since gawk has no predefined limits; they are only for compatibility with the Bell Labs research version of Unix awk.
-v var=val
--assign var=val
Assign the variable var the value val before program execution begins.
-W traditional
-W compat
--traditional
--compat
Use compatibility mode, in which gawk extensions are turned off.
-W copyleft
-W copyright
--copyleft
--copyright
Print the short version of the General Public License on the standard output, and exit. This option may disappear in a future version of gawk.
-W help
-W usage
--help
--usage
Print a relatively short summary of the available options on the standard output, and exit.
-W lint
--lint
Give warnings about dubious or non-portable awk constructs.
-W lint-old
--lint-old
Warn about constructs that are not available in the original Version 7 Unix version of awk.
-W posix
--posix
Use POSIX compatibility mode, in which gawk extensions are turned off and additional restrictions apply.
-W re-interval
--re-interval
Allow interval expressions (see section Regular Expression Operators), in regexps.
-W source=program-text
--source program-text
Use program-text as awk program source code. This option allows mixing command line source code with source code from files, and is particularly useful for mixing command line programs with library functions.
-W version
--version
Print version information for this particular copy of gawk on the error output.
--
Signal the end of options. This is useful to allow further arguments to the awk program itself to start with a `-'. This is mainly for consistency with POSIX argument parsing conventions.

Any other options are flagged as invalid, but are otherwise ignored. See section Command Line Options, for more details.


Go to the first, previous, next, last section, table of contents.