GAWK (1)
pattern scanning and processing language
SYNOPSIS
gawk
[ POSIX or GNU style options ]
-f
program-file
[
-\^-
] file .\^.\^.
gawk
[ POSIX or GNU style options ]
[
-\^-
]
program-text
file .\^.\^.
DESCRIPTION
Gawk
is the GNU Project's implementation of the AWK programming language.
It conforms to the definition of the language in
the \*(PX 1003.2 Command Language And Utilities Standard.
This version in turn is based on the description in
The AWK Programming Language
by Aho, Kernighan, and Weinberger,
with the additional features found in the System V Release 4 version
of \*(UX
awk .
Gawk
also provides more recent Bell Labs
awk
extensions, and some GNU-specific extensions.
The command line consists of options to
gawk
itself, the AWK program text (if not supplied via the
-f
or
-\^-file
options), and values to be made
available in the
ARGC
and
ARGV
pre-defined AWK variables.
OPTION FORMAT
Gawk
options may be either the traditional \*(PX one letter options,
or the GNU style long options. \*(PX options start with a single ``-'',
while long options start with ``-\^-''.
Long options are provided for both GNU-specific features and
for \*(PX mandated features.
Following the \*(PX standard,
gawk -specific
options are supplied via arguments to the
-W
option. Multiple
-W
options may be supplied
Each
-W
option has a corresponding long option, as detailed below.
Arguments to long options are either joined with the option
by an
=
sign, with no intervening spaces, or they may be provided in the
next command line argument.
Long options may be abbreviated, as long as the abbreviation
remains unique.
OPTIONS
Gawk
accepts the following options.
-F fs
-\^-field-separator fs
Use
fs
for the input field separator (the value of the
FS
predefined
variable).
-v var\^=\^val
-\^-assign var\^=\^val
Assign the value
val ,
to the variable
var ,
before execution of the program begins.
Such variable values are available to the
BEGIN
block of an AWK program.
-f program-file
-\^-file program-file
Read the AWK program source from the file
program-file ,
instead of from the first command line argument.
Multiple
-f
(or
-\^-file )
options may be used.
-mf NNN
-mr NNN
Set various memory limits to the value
NNN .
The
f
flag sets the maximum number of fields, and the
r
flag sets the maximum record size. These two flags and the
-m
option are from the Bell Labs research version of \*(UX
awk .
They are ignored by
gawk ,
since
gawk
has no pre-defined limits.
-W traditional
-W compat
-\^-traditional
-\^-compat
Run in
compatibility
mode. In compatibility mode,
gawk
behaves identically to \*(UX
awk ;
none of the GNU-specific extensions are recognized.
The use of
-\^-traditional
is preferred over the other forms of this option.
See
GNU EXTENSIONS
below, for more information.
-W copyleft
-W copyright
-\^-copyleft
-\^-copyright
Print the short version of the GNU copyright information message on
the standard output, and exits successfully.
-W help
-W usage
-\^-help
-\^-usage
Print a relatively short summary of the available options on
the standard output.
(Per the
GNU Coding Standards
these options cause an immediate, successful exit.)
-W lint
-\^-lint
Provide warnings about constructs that are
dubious or non-portable to other AWK implementations.
-W lint-old
-\^-lint-old
Provide warnings about constructs that are
not portable to the original version of Unix
awk .
|
|