Next: Common Extensions, Previous: POSIX/GNU, Up: Language History [Contents][Index]
gawk
FeaturesThis section describes the features in gawk
over and above those in POSIX awk
,
in the order they were added to gawk
.
Version 2.10 of gawk
introduced the following features:
AWKPATH
environment variable for specifying a path search for
the -f command-line option
(see Options).
IGNORECASE
variable and its effects
(see Case-sensitivity).
Version 2.13 of gawk
introduced the following features:
FIELDWIDTHS
variable and its effects
(see Constant Size).
systime()
and strftime()
built-in functions for obtaining
and printing timestamps
(see Time Functions).
Version 2.14 of gawk
introduced the following feature:
next file
statement for skipping to the next data file
(see Nextfile Statement).
Version 2.15 of gawk
introduced the following features:
ARGIND
, which tracks the movement of FILENAME
through ARGV
.
ERRNO
, which contains the system error message when
getline
returns -1 or close()
fails.
Version 3.0 of gawk
introduced the following features:
IGNORECASE
changed, now applying to string comparison as well
as regexp operations
(see Case-sensitivity).
RT
, which contains the input text that matched RS
(see Records).
gensub()
function for more powerful text manipulation
(see String Functions).
strftime()
function acquired a default time format,
allowing it to be called with no arguments
(see Time Functions).
FS
and for the third
argument to split()
to be null strings
(see Single Character Fields).
RS
to be a regexp
(see Records).
next file
statement became nextfile
(see Nextfile Statement).
fflush()
function from
BWK awk
(then at Bell Laboratories;
see I/O Functions).
awk
(see V7/SVR3.1).
awk
. (Brian was
still at Bell Laboratories at the time.) This was later removed from
both his awk
and from gawk
.
Version 3.1 of gawk
introduced the following features:
BINMODE
, for non-POSIX systems,
which allows binary I/O for input and/or output files
(see PC Using).
LINT
, which dynamically controls lint warnings.
PROCINFO
, an array for providing process-related information.
TEXTDOMAIN
, for setting an application’s internationalization text domain
(see Internationalization).
awk
program source code
(see Nondecimal-numbers).
close()
that allows closing one end
of a two-way pipe to a coprocess
(see Two-way I/O).
match()
function
for capturing text-matching subexpressions within a regexp
(see String Functions).
printf
formats for
making translations easier
(see Printf Ordering).
asort()
and asorti()
functions for sorting arrays
(see Array Sorting).
bindtextdomain()
, dcgettext()
and dcngettext()
functions
for internationalization
(see Programmer i18n).
extension()
function and the ability to add
new built-in functions dynamically
(see Dynamic Extensions).
mktime()
function for creating timestamps
(see Time Functions).
and()
, or()
, xor()
, compl()
,
lshift()
, rshift()
, and strtonum()
functions
(see Bitwise Functions).
pgawk
, the
profiling version of gawk
, for producing execution
profiles of awk
programs
(see Profiling).
gawk
to use the locale’s decimal point for parsing input data
(see Conversion).
gettext
for gawk
’s own message output
(see Gawk I18N).
sub()
and gsub()
(see Gory Details).
length()
function was extended to accept an array argument
and return the number of elements in the array
(see String Functions).
strftime()
function acquired a third argument to
enable printing times as UTC
(see Time Functions).
Version 4.0 of gawk
introduced the following features:
FPAT
, which allows you to specify a regexp that matches
the fields, instead of matching the field separator
(see Splitting By Content).
PROCINFO["sorted_in"]
exists, ‘for(iggy in foo)’ loops sort the
indices before looping over them. The value of this element
provides control over how the indices are sorted before the loop
traversal starts
(see Controlling Scanning).
PROCINFO["strftime"]
, which holds
the default format for strftime()
(see Time Functions).
break
and continue
became invalid outside a loop,
even with --traditional
(see Break Statement, and also see
Continue Statement).
fflush()
, nextfile
, and ‘delete array’
are allowed if --posix or --traditional, since they
are all now part of POSIX.
asort()
and asorti()
, specifying how to sort
(see String Functions).
fflush()
changed to match BWK awk
and for POSIX; now both ‘fflush()’ and ‘fflush("")’
flush all open output redirections
(see I/O Functions).
isarray()
function which distinguishes if an item is an array
or not, to make it possible to traverse arrays of arrays
(see Type Functions).
patsplit()
function which gives the same capability as FPAT
, for splitting
(see String Functions).
split()
function,
which is an array to hold the values of the separators
(see String Functions).
BEGINFILE
and ENDFILE
special patterns
(see BEGINFILE/ENDFILE).
switch
/ case
are enabled by default
(see Switch Statement).
gawk
from treating input as a multibyte string.
gawk
internals were rewritten, bringing the dgawk
debugger and possibly improved performance
(see Debugger).
strcoll()
/ wcscoll()
(see POSIX String Comparison).
Version 4.1 of gawk
introduced the following features:
SYMTAB
, FUNCTAB
, and PROCINFO["identifiers"]
(see Auto-set).
gawk
, pgawk
, and dgawk
, were merged into
one, named just gawk
. As a result the command-line options changed.
awk
library files.
and()
, or()
and xor()
functions
changed to allow any number of arguments,
with a minimum of two
(see Bitwise Functions).
getline
became allowed inside
BEGINFILE
and ENDFILE
(see BEGINFILE/ENDFILE).
where
command was added to the debugger
(see Execution Stack).
Next: Common Extensions, Previous: POSIX/GNU, Up: Language History [Contents][Index]