gawk: POSIX/GNU

1 
1 A.5 Extensions in 'gawk' Not in POSIX 'awk'
1 ===========================================
1 
1 The GNU implementation, 'gawk', adds a large number of features.  They
1 can all be disabled with either the '--traditional' or '--posix' options
1 (⇒Options).
1 
1    A number of features have come and gone over the years.  This minor
1 node summarizes the additional features over POSIX 'awk' that are in the
1 current version of 'gawk'.
1 
1    * Additional predefined variables:
1 
1         - The 'ARGIND', 'BINMODE', 'ERRNO', 'FIELDWIDTHS', 'FPAT',
1           'IGNORECASE', 'LINT', 'PROCINFO', 'RT', and 'TEXTDOMAIN'
1           variables (⇒Built-in Variables)
1 
1    * Special files in I/O redirections:
1 
1         - The '/dev/stdin', '/dev/stdout', '/dev/stderr', and
1           '/dev/fd/N' special file names (⇒Special Files)
1 
1         - The '/inet', '/inet4', and '/inet6' special files for TCP/IP
1           networking using '|&' to specify which version of the IP
1           protocol to use (⇒TCP/IP Networking)
1 
1    * Changes and/or additions to the language:
1 
1         - The '\x' escape sequence (⇒Escape Sequences)
1 
1         - Full support for both POSIX and GNU regexps (⇒Regexp)
1 
1         - The ability for 'FS' and for the third argument to 'split()'
1           to be null strings (⇒Single Character Fields)
1 
1         - The ability for 'RS' to be a regexp (⇒Records)
1 
1         - The ability to use octal and hexadecimal constants in 'awk'
1           program source code (⇒Nondecimal-numbers)
1 
1           Two-way I/O::)
1 
1         - Indirect function calls (⇒Indirect Calls)
1 
1         - Directories on the command line produce a warning and are
1           skipped (⇒Command-line directories)
1 
1           Nonfatal::)
1 
1    * New keywords:
1 
1           BEGINFILE/ENDFILE::)
1 
1         - The 'switch' statement (⇒Switch Statement)
1 
1    * Changes to standard 'awk' functions:
1 
1         - The optional second argument to 'close()' that allows closing
1           one end of a two-way pipe to a coprocess (⇒Two-way I/O)
1 
1         - POSIX compliance for 'gsub()' and 'sub()' with '--posix'
1 
1         - The 'length()' function accepts an array argument and returns
1           the number of elements in the array (⇒String Functions)
1 
1         - The optional third argument to the 'match()' function for
1           String Functions::)
1 
1         - Positional specifiers in 'printf' formats for making
1           translations easier (⇒Printf Ordering)
1 
1         - The 'split()' function's additional optional fourth argument,
1           which is an array to hold the text of the field separators
1           (⇒String Functions)
1 
1    * Additional functions only in 'gawk':
1 
1         - The 'gensub()', 'patsplit()', and 'strtonum()' functions for
1           more powerful text manipulation (⇒String Functions)
1 
1         - The 'asort()' and 'asorti()' functions for sorting arrays
1           (⇒Array Sorting)
1 
1         - The 'mktime()', 'systime()', and 'strftime()' functions for
1           working with timestamps (⇒Time Functions)
1 
1         - The 'and()', 'compl()', 'lshift()', 'or()', 'rshift()', and
1           Functions::)
1 
1         - The 'isarray()' function to check if a variable is an array or
1           not (⇒Type Functions)
1 
1         - The 'bindtextdomain()', 'dcgettext()', and 'dcngettext()'
1           functions for internationalization (⇒Programmer i18n)
1 
1    * Changes and/or additions in the command-line options:
1 
1         - The 'AWKPATH' environment variable for specifying a path
1           search for the '-f' command-line option (⇒Options)
1 
1         - The 'AWKLIBPATH' environment variable for specifying a path
1           search for the '-l' command-line option (⇒Options)
1 
1         - The '-b', '-c', '-C', '-d', '-D', '-e', '-E', '-g', '-h',
1           '-i', '-l', '-L', '-M', '-n', '-N', '-o', '-O', '-p', '-P',
1           '-r', '-s', '-S', '-t', and '-V' short options.  Also, the
1           ability to use GNU-style long-named options that start with
1           '--', and the '--assign', '--bignum', '--characters-as-bytes',
1           '--copyright', '--debug', '--dump-variables', '--exec',
1           '--field-separator', '--file', '--gen-pot', '--help',
1           '--include', '--lint', '--lint-old', '--load',
1           '--non-decimal-data', '--optimize', '--no-optimize',
1           '--posix', '--pretty-print', '--profile', '--re-interval',
1           '--sandbox', '--source', '--traditional', '--use-lc-numeric',
1           and '--version' long options (⇒Options).
1 
1    * Support for the following obsolete systems was removed from the
1      code and the documentation for 'gawk' version 4.0:
1 
1         - Amiga
1 
1         - Atari
1 
1         - BeOS
1 
1         - Cray
1 
1         - MIPS RiscOS
1 
1         - MS-DOS with the Microsoft Compiler
1 
1         - MS-Windows with the Microsoft Compiler
1 
1         - NeXT
1 
1         - SunOS 3.x, Sun 386 (Road Runner)
1 
1         - Tandem (non-POSIX)
1 
1         - Prestandard VAX C compiler for VAX/VMS
1 
1         - GCC for VAX and Alpha has not been tested for a while.
1 
1    * Support for the following obsolete system was removed from the code
1      for 'gawk' version 4.1:
1 
1         - Ultrix
1 
1    * Support for the following systems was removed from the code for
1      'gawk' version 4.2:
1 
1         - MirBSD
1 
1         - GNU/Linux on Alpha
1