gawk: POSIX/GNU

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