gawk
Not in POSIX awk
¶The GNU implementation, gawk
, adds a large number of features.
They can all be disabled with either the --traditional or
--posix options
(see Command-Line Options).
A number of features have come and gone over the years. This section
summarizes the additional features over POSIX awk
that are
in the current version of gawk
.
ARGIND
,
BINMODE
,
ERRNO
,
FIELDWIDTHS
,
FPAT
,
IGNORECASE
,
LINT
,
PROCINFO
,
RT
,
and
TEXTDOMAIN
variables
(see Predefined Variables)
gawk
)
gawk
for Network Programming)
FS
and for the third
argument to split()
to be null strings
(see Making Each Character a Separate Field)
RS
to be a regexp
(see How Input Is Split into Records)
awk
program source code
(see Octal and Hexadecimal Numbers)
print
and printf
need not be fatal
(see Enabling Nonfatal Output)
::
to designate an identifier
within a namespace
(see Namespaces in gawk
).
BEGINFILE
and ENDFILE
special patterns
(see The BEGINFILE
and ENDFILE
Special Patterns)
switch
statement
(see The switch
Statement)
awk
functions:
close()
that allows closing one end
of a two-way pipe to a coprocess
(see Two-Way Communications with Another Process)
gsub()
and sub()
with --posix
length()
function accepts an array argument
and returns the number of elements in the array
(see String-Manipulation Functions)
match()
function
for capturing text-matching subexpressions within a regexp
(see String-Manipulation Functions)
printf
formats for
making translations easier
(see Rearranging printf
Arguments)
split()
function’s additional optional fourth
argument, which is an array to hold the text of the field separators
(see String-Manipulation Functions)
gawk
:
gensub()
, patsplit()
, and strtonum()
functions
for more powerful text manipulation
(see String-Manipulation Functions)
asort()
and asorti()
functions for sorting arrays
(see Controlling Array Traversal and Array Sorting)
mktime()
, systime()
, and strftime()
functions for working with timestamps
(see Time Functions)
and()
,
compl()
,
lshift()
,
or()
,
rshift()
,
and
xor()
functions for bit manipulation
(see Bit-Manipulation Functions)
isarray()
function to check whether a variable is an array, and
the more general typeof()
function
(see Getting Type Information)
mkbool()
function to create a Boolean value
(see Generating Boolean Values)
bindtextdomain()
, dcgettext()
, and dcngettext()
functions for internationalization
(see Internationalizing awk
Programs)
AWKPATH
environment variable for specifying a path search for
the -f command-line option
(see Command-Line Options)
AWKLIBPATH
environment variable for specifying a path search for
the -l command-line option
(see Command-Line Options)
gawk
version 4.0:
gawk
version 4.1:
gawk
version 4.2:
gawk
version 5.2: