Go to the first, previous, next, last section, table of contents.
The following is an alphabetical list of variables that you can change to control how @command{awk} does certain things. The variables that are specific to @command{gawk} are marked with a pound sign (`#').
BINMODE #
"r" or "w" specify that input files and
output files, respectively, should use binary I/O.
A string value of "rw" or "wr" indicates that all
files should use binary I/O.
Any other string value is equivalent to "rw", but @command{gawk}
generates a warning message.
BINMODE is described in more detail in
@ref{PC Using, ,Using @command{gawk} on PC Operating Systems}.
This variable is a @command{gawk} extension.
In other @command{awk} implementations
(except @command{mawk},
@pxref{Other Versions, , Other Freely Available @command{awk} Implementations}),
or if @command{gawk} is in compatibility mode
(see section Command-Line Options),
it is not special.
CONVFMT
sprintf function
(see section String Manipulation Functions).
Its default value is "%.6g".
CONVFMT was introduced by the POSIX standard.
FIELDWIDTHS #
FIELDWIDTHS
overrides the use of FS for field splitting.
See section Reading Fixed-Width Data, for more information.
If @command{gawk} is in compatibility mode
(see section Command-Line Options), then FIELDWIDTHS
has no special meaning, and field-splitting operations occur based
exclusively on the value of FS.
FS
""), then each
character in the record becomes a separate field.
(This behavior is a @command{gawk} extension. POSIX @command{awk} does not
specify the behavior when FS is the null string.)
The default value is " ", a string consisting of a single
space. As a special exception, this value means that any
sequence of spaces, tabs, and/or newlines is a single separator.(24), newline does not count as whitespace.} It also causes
spaces, tabs, and newlines at the beginning and end of a record to be ignored.
You can set the value of FS on the command line using the
@option{-F} option:
awk -F, 'program' input-filesIf @command{gawk} is using
FIELDWIDTHS for field splitting,
assigning a value to FS causes @command{gawk} to return to
the normal, FS-based field splitting. An easy way to do this
is to simply say `FS = FS', perhaps with an explanatory comment.
IGNORECASE #
IGNORECASE is nonzero or non-null, then all string comparisons
and all regular expression matching are case-independent. Thus, regexp
matching with `~' and `!~', as well as the gensub,
gsub, index, match, split, and sub
functions, record termination with RS, and field splitting with
FS, all ignore case when doing their particular regexp operations.
However, the value of IGNORECASE does not affect array subscripting.
See section Case Sensitivity in Matching.
If @command{gawk} is in compatibility mode
(see section Command-Line Options),
then IGNORECASE has no special meaning. Thus, string
and regexp operations are always case-sensitive.
LINT #
"fatal", lint warnings become fatal errors.
Any other true value prints non-fatal warnings.
Assigning a false value to LINT turns off the lint warnings.
This variable is a @command{gawk} extension. It is not special
in other @command{awk} implementations. Unlike the other special variables,
changing LINT does affect the production of lint warnings,
even if @command{gawk} is in compatibility mode. Much as
the @option{--lint} and @option{--traditional} options independently
control different aspects of @command{gawk}'s behavior, the control
of lint warnings during program execution is independent of the flavor
of @command{awk} being executed.
OFMT
print statement. It works by being passed
as the first argument to the sprintf function
(see section String Manipulation Functions).
Its default value is "%.6g". Earlier versions of @command{awk}
also used OFMT to specify the format for converting numbers to
strings in general expressions; this is now done by CONVFMT.
OFS
print statement. Its
default value is " ", a string consisting of a single space.
ORS
print statement. Its default value is "\n", the newline
character. (See section Output Separators.)
RS
RS to be a regular expression
is a @command{gawk} extension.
In most other @command{awk} implementations,
or if @command{gawk} is in compatibility mode
(see section Command-Line Options),
just the first character of RS's value is used.
SUBSEP
"\034" and is used to separate the parts of the indices of a
multidimensional array. Thus, the expression foo["A", "B"]
really accesses foo["A\034B"]
(see section Multidimensional Arrays).
TEXTDOMAIN #
dcgettext and bindtextdomain functions
(@pxref{Internationalization, ,Internationalization with @command{gawk}}).
The default value of TEXTDOMAIN is "messages".
This variable is a @command{gawk} extension.
In other @command{awk} implementations,
or if @command{gawk} is in compatibility mode
(see section Command-Line Options),
it is not special.
Go to the first, previous, next, last section, table of contents.