{
    "mode": "man",
    "parameter": "awk",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/awk/1/json",
    "generated": "2026-06-10T16:05:28Z",
    "synopsis": "gawk [ POSIX or GNU style options ] -f program-file [ -- ] file ...\ngawk [ POSIX or GNU style options ] [ -- ] program-text file ...",
    "sections": {
        "NAME": {
            "content": "gawk - pattern scanning and processing language\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "gawk [ POSIX or GNU style options ] -f program-file [ -- ] file ...\ngawk [ POSIX or GNU style options ] [ -- ] program-text file ...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Gawk is the GNU Project's implementation of the AWK programming language.  It conforms to the\ndefinition of the language in the POSIX 1003.1 standard.  This version in turn  is  based  on\nthe  description  in  The  AWK Programming Language, by Aho, Kernighan, and Weinberger.  Gawk\nprovides the additional features found in the current version of Brian  Kernighan's  awk  and\nnumerous GNU-specific extensions.\n\nThe  command  line  consists of options to gawk itself, the AWK program text (if not supplied\nvia the -f or --include options), and values to be made available in the ARGC and  ARGV  pre-\ndefined AWK variables.\n\nWhen gawk is invoked with the --profile option, it starts gathering profiling statistics from\nthe execution of the program.  Gawk runs more slowly in this mode, and automatically produces\nan execution profile in the file awkprof.out when done.  See the --profile option, below.\n\nGawk also has an integrated debugger. An interactive debugging session can be started by sup‐\nplying the --debug option to the command line. In this mode of execution, gawk loads the  AWK\nsource  code and then prompts for debugging commands.  Gawk can only debug AWK program source\nprovided with the -f and --include options.  The debugger is documented  in  GAWK:  Effective\nAWK Programming.\n",
            "subsections": []
        },
        "OPTION FORMAT": {
            "content": "Gawk  options may be either traditional POSIX-style one letter options, or GNU-style long op‐\ntions.  POSIX options start with a single “-”, while long options start with “--”.  Long  op‐\ntions are provided for both GNU-specific features and for POSIX-mandated features.\n\nGawk-specific  options are typically used in long-option form.  Arguments to long options are\neither joined with the option by an = sign, with no intervening spaces, or they may  be  pro‐\nvided in the next command line argument.  Long options may be abbreviated, as long as the ab‐\nbreviation remains unique.\n\nAdditionally, every long option has a corresponding short option, so that the option's  func‐\ntionality may be used from within #!  executable scripts.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "Gawk  accepts  the following options.  Standard options are listed first, followed by options\nfor gawk extensions, listed alphabetically by short option.\n",
            "subsections": [
                {
                    "name": "-f",
                    "content": "--file program-file\nRead the AWK program source from the file program-file, instead of from the first com‐\nmand  line argument.  Multiple -f (or --file) options may be used.  Files read with -f\nare treated as if they begin with an implicit @namespace \"awk\" statement.\n",
                    "flag": "-f"
                },
                {
                    "name": "-F",
                    "content": "--field-separator fs\nUse fs for the input field separator (the value of the FS predefined variable).\n",
                    "flag": "-F"
                },
                {
                    "name": "-v",
                    "content": "--assign var=val\nAssign the value val to the variable var, before  execution  of  the  program  begins.\nSuch variable values are available to the BEGIN rule of an AWK program.\n",
                    "flag": "-v"
                },
                {
                    "name": "-b",
                    "content": "",
                    "flag": "-b"
                },
                {
                    "name": "--characters-as-bytes",
                    "content": "Treat  all  input data as single-byte characters. In other words, don't pay any atten‐\ntion to the locale information when attempting to process strings as multibyte charac‐\nters.  The --posix option overrides this one.\n",
                    "long": "--characters-as-bytes"
                },
                {
                    "name": "-c",
                    "content": "",
                    "flag": "-c"
                },
                {
                    "name": "--traditional",
                    "content": "Run  in  compatibility mode.  In compatibility mode, gawk behaves identically to Brian\nKernighan's awk; none of the GNU-specific extensions are recognized.  See  GNU  EXTEN‐‐\nSIONS, below, for more information.\n",
                    "long": "--traditional"
                },
                {
                    "name": "-C",
                    "content": "",
                    "flag": "-C"
                },
                {
                    "name": "--copyright",
                    "content": "Print  the short version of the GNU copyright information message on the standard out‐\nput and exit successfully.\n",
                    "long": "--copyright"
                },
                {
                    "name": "-d",
                    "content": "--dump-variables[=file]\nPrint a sorted list of global variables, their types and final values to file.  If  no\nfile is provided, gawk uses a file named awkvars.out in the current directory.\nHaving  a list of all the global variables is a good way to look for typographical er‐\nrors in your programs.  You would also use this option if you  have  a  large  program\nwith  a  lot  of functions, and you want to be sure that your functions don't inadver‐\ntently use global variables that you meant to be local.  (This is a particularly  easy\nmistake to make with simple variable names like i, j, and so on.)\n",
                    "flag": "-d"
                },
                {
                    "name": "-D",
                    "content": "--debug[=file]\nEnable  debugging  of  AWK programs.  By default, the debugger reads commands interac‐\ntively from the keyboard (standard input).  The optional  file  argument  specifies  a\nfile with a list of commands for the debugger to execute non-interactively.\n",
                    "flag": "-D"
                },
                {
                    "name": "-e",
                    "content": "--source program-text\nUse  program-text as AWK program source code.  This option allows the easy intermixing\nof library functions (used via the -f and --include options) with source code  entered\non  the  command line.  It is intended primarily for medium to large AWK programs used\nin shell scripts.  Each argument supplied via -e is treated as if it  begins  with  an\nimplicit @namespace \"awk\" statement.\n",
                    "flag": "-e"
                },
                {
                    "name": "-E",
                    "content": "--exec file\nSimilar to -f, however, this is option is the last one processed.  This should be used\nwith #!  scripts, particularly for CGI applications, to avoid passing  in  options  or\nsource  code  (!)  on  the command line from a URL.  This option disables command-line\nvariable assignments.\n",
                    "flag": "-E"
                },
                {
                    "name": "-g",
                    "content": "",
                    "flag": "-g"
                },
                {
                    "name": "--gen-pot",
                    "content": "Scan and parse the AWK program, and generate a GNU  .pot  (Portable  Object  Template)\nformat  file  on  standard output with entries for all localizable strings in the pro‐\ngram.  The program itself is not executed.  See the GNU gettext distribution for  more\ninformation on .pot files.\n",
                    "long": "--gen-pot"
                },
                {
                    "name": "-h",
                    "content": "--help Print  a  relatively  short  summary  of the available options on the standard output.\n(Per the GNU Coding Standards, these options cause an immediate, successful exit.)\n",
                    "flag": "-h"
                },
                {
                    "name": "-i",
                    "content": "--include include-file\nLoad an awk source library.  This searches for the library using the AWKPATH  environ‐\nment  variable.   If  the initial search fails, another attempt will be made after ap‐\npending the .awk suffix.  The file will be loaded  only  once  (i.e.,  duplicates  are\neliminated),  and  the  code  does not constitute the main program source.  Files read\nwith --include are treated as if they begin with an implicit @namespace  \"awk\"  state‐\nment.\n",
                    "flag": "-i"
                },
                {
                    "name": "-l",
                    "content": "--load lib\nLoad  a gawk extension from the shared library lib.  This searches for the library us‐\ning the AWKLIBPATH environment variable.  If the initial search fails, another attempt\nwill  be made after appending the default shared library suffix for the platform.  The\nlibrary initialization routine is expected to be named dlload().\n",
                    "flag": "-l"
                },
                {
                    "name": "-L",
                    "content": "--lint[=value]\nProvide warnings about constructs that are dubious or non-portable to other AWK imple‐\nmentations.   With  an  optional argument of fatal, lint warnings become fatal errors.\nThis may be drastic, but its use will certainly encourage the development  of  cleaner\nAWK  programs.   With an optional argument of invalid, only warnings about things that\nare actually invalid are issued. (This is not fully implemented  yet.)   With  an  op‐\ntional argument of no-ext, warnings about gawk extensions are disabled.\n",
                    "flag": "-L"
                },
                {
                    "name": "-M",
                    "content": "",
                    "flag": "-M"
                },
                {
                    "name": "--bignum",
                    "content": "Force  arbitrary precision arithmetic on numbers. This option has no effect if gawk is\nnot compiled to use the GNU MPFR and GMP libraries.  (In such a case,  gawk  issues  a\nwarning.)\n",
                    "long": "--bignum"
                },
                {
                    "name": "-n",
                    "content": "",
                    "flag": "-n"
                },
                {
                    "name": "--non-decimal-data",
                    "content": "Recognize octal and hexadecimal values in input data.  Use this option with great cau‐\ntion!\n",
                    "long": "--non-decimal-data"
                },
                {
                    "name": "-N",
                    "content": "",
                    "flag": "-N"
                },
                {
                    "name": "--use-lc-numeric",
                    "content": "Force gawk to use the locale's decimal point character when parsing input  data.   Al‐\nthough  the POSIX standard requires this behavior, and gawk does so when --posix is in\neffect, the default is to follow traditional behavior and use a period as the  decimal\npoint,  even in locales where the period is not the decimal point character.  This op‐\ntion overrides the default behavior, without the  full  draconian  strictness  of  the\n--posix option.\n",
                    "long": "--use-lc-numeric"
                },
                {
                    "name": "-o",
                    "content": "--pretty-print[=file]\nOutput  a pretty printed version of the program to file.  If no file is provided, gawk\nuses a file named awkprof.out in the current directory.  This option implies  --no-op‐‐\ntimize.\n",
                    "flag": "-o"
                },
                {
                    "name": "-O",
                    "content": "",
                    "flag": "-O"
                },
                {
                    "name": "--optimize",
                    "content": "Enable  gawk's  default optimizations upon the internal representation of the program.\nCurrently, this just includes simple constant folding.  This option is on by default.\n",
                    "long": "--optimize"
                },
                {
                    "name": "-p",
                    "content": "--profile[=prof-file]\nStart a profiling session, and send the profiling data to prof-file.  The  default  is\nawkprof.out.   The  profile contains execution counts of each statement in the program\nin the left margin and function call counts for each user-defined function.  This  op‐\ntion implies --no-optimize.\n",
                    "flag": "-p"
                },
                {
                    "name": "-P",
                    "content": "",
                    "flag": "-P"
                },
                {
                    "name": "--posix",
                    "content": "This turns on compatibility mode, with the following additional restrictions:\n\n• \\x escape sequences are not recognized.\n\n• You cannot continue lines after ?  and :.\n\n• The synonym func for the keyword function is not recognized.\n\n• The operators  and = cannot be used in place of ^ and ^=.\n",
                    "long": "--posix"
                },
                {
                    "name": "-r",
                    "content": "",
                    "flag": "-r"
                },
                {
                    "name": "--re-interval",
                    "content": "Enable the use of interval expressions in regular expression matching (see Regular Ex‐‐\npressions, below).  Interval expressions were not traditionally available in  the  AWK\nlanguage.   The  POSIX standard added them, to make awk and egrep consistent with each\nother.  They are enabled by default, but this option remains  for  use  together  with\n--traditional.\n",
                    "long": "--re-interval"
                },
                {
                    "name": "-s",
                    "content": "",
                    "flag": "-s"
                },
                {
                    "name": "--no-optimize",
                    "content": "Disable gawk's default optimizations upon the internal representation of the program.\n",
                    "long": "--no-optimize"
                },
                {
                    "name": "-S",
                    "content": "",
                    "flag": "-S"
                },
                {
                    "name": "--sandbox",
                    "content": "Run gawk in sandbox mode, disabling the system() function, input redirection with get‐‐\nline, output redirection with print and printf, and loading dynamic extensions.   Com‐\nmand execution (through pipelines) is also disabled.  This effectively blocks a script\nfrom accessing local resources, except for the files specified on the command line.\n",
                    "long": "--sandbox"
                },
                {
                    "name": "-t",
                    "content": "",
                    "flag": "-t"
                },
                {
                    "name": "--lint-old",
                    "content": "Provide warnings about constructs that are not portable to  the  original  version  of\nUNIX awk.\n",
                    "long": "--lint-old"
                },
                {
                    "name": "-V",
                    "content": "",
                    "flag": "-V"
                },
                {
                    "name": "--version",
                    "content": "Print  version  information  for  this particular copy of gawk on the standard output.\nThis is useful mainly for knowing if the current copy of gawk on your system is up  to\ndate  with  respect to whatever the Free Software Foundation is distributing.  This is\nalso useful when reporting bugs.  (Per the GNU Coding Standards, these  options  cause\nan immediate, successful exit.)\n\n--     Signal  the  end of options. This is useful to allow further arguments to the AWK pro‐\ngram itself to start with a “-”.  This provides consistency with the argument  parsing\nconvention used by most other POSIX programs.\n\nIn  compatibility  mode, any other options are flagged as invalid, but are otherwise ignored.\nIn normal operation, as long as program text has been supplied, unknown options are passed on\nto the AWK program in the ARGV array for processing.  This is particularly useful for running\nAWK programs via the #!  executable interpreter mechanism.\n\nFor POSIX compatibility, the -W option may be used, followed by the name of a long option.\n",
                    "long": "--version"
                }
            ]
        },
        "AWK PROGRAM EXECUTION": {
            "content": "An AWK program consists of a sequence of optional directives, pattern-action statements,  and\noptional function definitions.\n\n@include \"filename\"\n@load \"filename\"\n@namespace \"name\"\npattern   { action statements }\nfunction name(parameter list) { statements }\n\nGawk  first reads the program source from the program-file(s) if specified, from arguments to\n--source, or from the first non-option argument on the command line.  The -f and --source op‐\ntions  may be used multiple times on the command line.  Gawk reads the program text as if all\nthe program-files and command line source texts had been concatenated together.  This is use‐\nful  for  building libraries of AWK functions, without having to include them in each new AWK\nprogram that uses them.  It also provides the ability to mix library functions  with  command\nline programs.\n\nIn  addition,  lines  beginning  with @include may be used to include other source files into\nyour program, making library use even easier.  This is equivalent to using the --include  op‐\ntion.\n\nLines  beginning  with @load may be used to load extension functions into your program.  This\nis equivalent to using the --load option.\n\nThe environment variable AWKPATH specifies a search path to use  when  finding  source  files\nnamed  with  the -f and --include options.  If this variable does not exist, the default path\nis \".:/usr/local/share/awk\".  (The actual directory may vary, depending  upon  how  gawk  was\nbuilt  and  installed.)   If  a file name given to the -f option contains a “/” character, no\npath search is performed.\n\nThe environment variable AWKLIBPATH specifies a search path to use when finding source  files\nnamed with the --load option.  If this variable does not exist, the default path is \"/usr/lo‐‐\ncal/lib/gawk\".  (The actual directory may vary, depending upon how gawk  was  built  and  in‐\nstalled.)\n\nGawk executes AWK programs in the following order.  First, all variable assignments specified\nvia the -v option are performed.  Next, gawk compiles the  program  into  an  internal  form.\nThen,  gawk  executes  the code in the BEGIN rule(s) (if any), and then proceeds to read each\nfile named in the ARGV array (up to ARGV[ARGC-1]).  If there are no files named on  the  com‐\nmand line, gawk reads the standard input.\n\nIf  a  filename  on the command line has the form var=val it is treated as a variable assign‐\nment.  The variable var will be assigned the  value  val.   (This  happens  after  any  BEGIN\nrule(s)  have been run.)  Command line variable assignment is most useful for dynamically as‐\nsigning values to the variables AWK uses to control how  input  is  broken  into  fields  and\nrecords.  It is also useful for controlling state if multiple passes are needed over a single\ndata file.\n\nIf the value of a particular element of ARGV is empty (\"\"), gawk skips over it.\n\nFor each input file, if a BEGINFILE rule exists, gawk executes  the  associated  code  before\nprocessing  the  contents of the file. Similarly, gawk executes the code associated with END‐‐\nFILE after processing the file.\n\nFor each record in the input, gawk tests to see if it matches any pattern in the AWK program.\nFor  each pattern that the record matches, gawk executes the associated action.  The patterns\nare tested in the order they occur in the program.\n\nFinally, after all the input is exhausted, gawk executes the code  in  the  END  rule(s)  (if\nany).\n",
            "subsections": [
                {
                    "name": "Command Line Directories",
                    "content": "According  to POSIX, files named on the awk command line must be text files.  The behavior is\n``undefined'' if they are not.  Most versions of awk treat a directory on the command line as\na fatal error.\n\nStarting with version 4.0 of gawk, a directory on the command line produces a warning, but is\notherwise skipped.  If either of the --posix or --traditional options is given, then gawk re‐\nverts to treating directories on the command line as a fatal error.\n"
                },
                {
                    "name": "VARIABLES, RECORDS AND FIELDS",
                    "content": "AWK  variables  are dynamic; they come into existence when they are first used.  Their values\nare either floating-point numbers or strings, or both, depending upon how they are used.  Ad‐\nditionally,  gawk  allows variables to have regular-expression type.  AWK also has one dimen‐\nsional arrays; arrays with multiple dimensions may be simulated.  Gawk provides  true  arrays\nof arrays; see Arrays, below.  Several pre-defined variables are set as a program runs; these\nare described as needed and summarized below.\n"
                },
                {
                    "name": "Records",
                    "content": "Normally, records are separated by newline characters.  You can control how records are sepa‐\nrated  by  assigning values to the built-in variable RS.  If RS is any single character, that\ncharacter separates records.  Otherwise, RS is a regular expression.  Text in the input  that\nmatches  this  regular expression separates the record.  However, in compatibility mode, only\nthe first character of its string value is used for separating records.  If RS is set to  the\nnull  string,  then records are separated by empty lines.  When RS is set to the null string,\nthe newline character always acts as a field separator, in addition to whatever value FS  may\nhave.\n"
                },
                {
                    "name": "Fields",
                    "content": "As  each  input record is read, gawk splits the record into fields, using the value of the FS\nvariable as the field separator.  If FS is a single character, fields are separated  by  that\ncharacter.   If  FS  is  the  null  string, then each individual character becomes a separate\nfield.  Otherwise, FS is expected to be a full regular expression.  In the special case  that\nFS  is  a  single  space, fields are separated by runs of spaces and/or tabs and/or newlines.\nNOTE: The value of IGNORECASE (see below) also affects how fields are split when FS is a reg‐\nular expression, and how records are separated when RS is a regular expression.\n\nIf  the  FIELDWIDTHS  variable is set to a space-separated list of numbers, each field is ex‐\npected to have fixed width, and gawk splits up the record using the specified  widths.   Each\nfield  width  may  optionally be preceded by a colon-separated value specifying the number of\ncharacters to skip before the field starts.  The value of FS is  ignored.   Assigning  a  new\nvalue to FS or FPAT overrides the use of FIELDWIDTHS.\n\nSimilarly,  if  the  FPAT variable is set to a string representing a regular expression, each\nfield is made up of text that matches that regular expression. In this case, the regular  ex‐\npression describes the fields themselves, instead of the text that separates the fields.  As‐\nsigning a new value to FS or FIELDWIDTHS overrides the use of FPAT.\n\nEach field in the input record may be referenced by its position: $1, $2, and so on.   $0  is\nthe  whole  record, including leading and trailing whitespace.  Fields need not be referenced\nby constants:\n\nn = 5\nprint $n\n\nprints the fifth field in the input record.\n\nThe variable NF is set to the total number of fields in the input record.\n\nReferences to non-existent fields (i.e., fields after $NF) produce the null string.  However,\nassigning  to a non-existent field (e.g., $(NF+2) = 5) increases the value of NF, creates any\nintervening fields with the null string as their values, and causes the value of $0 to be re‐\ncomputed,  with  the fields being separated by the value of OFS.  References to negative num‐\nbered fields cause a fatal error.  Decrementing NF causes the values of fields past  the  new\nvalue  to  be  lost, and the value of $0 to be recomputed, with the fields being separated by\nthe value of OFS.\n\nAssigning a value to an existing field causes the whole record to be rebuilt when $0 is  ref‐\nerenced.   Similarly,  assigning  a value to $0 causes the record to be resplit, creating new\nvalues for the fields.\n"
                },
                {
                    "name": "Built-in Variables",
                    "content": "Gawk's built-in variables are:\n\nARGC        The number of command line arguments (does not include options to  gawk,  or  the\nprogram source).\n\nARGIND      The index in ARGV of the current file being processed.\n\nARGV        Array  of  command line arguments.  The array is indexed from 0 to ARGC - 1.  Dy‐\nnamically changing the contents of ARGV can control the files used for data.\n\nBINMODE     On non-POSIX systems, specifies use of “binary” mode for all file  I/O.   Numeric\nvalues  of  1, 2, or 3, specify that input files, output files, or all files, re‐\nspectively, should use binary I/O.  String values of \"r\", or \"w\" specify that in‐\nput  files,  or output files, respectively, should use binary I/O.  String values\nof \"rw\" or \"wr\" specify that all files should use binary I/O.  Any  other  string\nvalue is treated as \"rw\", but generates a warning message.\n\nCONVFMT     The conversion format for numbers, \"%.6g\", by default.\n\nENVIRON     An  array containing the values of the current environment.  The array is indexed\nby the environment variables, each element  being  the  value  of  that  variable\n(e.g., ENVIRON[\"HOME\"] might be \"/home/arnold\").\n\nIn  POSIX  mode, changing this array does not affect the environment seen by pro‐\ngrams which gawk spawns via redirection or  the  system()  function.   Otherwise,\ngawk updates its real environment so that programs it spawns see the changes.\n\nERRNO       If  a  system  error occurs either doing a redirection for getline, during a read\nfor getline, or during a close(), then ERRNO is set to a  string  describing  the\nerror.   The  value  is  subject  to  translation in non-English locales.  If the\nstring in ERRNO corresponds to a system error in the errno(3) variable, then  the\nnumeric  value  can  be  found  in  PROCINFO[\"errno\"].   For  non-system  errors,\nPROCINFO[\"errno\"] will be zero.\n\nFIELDWIDTHS A whitespace-separated list of field widths.  When set,  gawk  parses  the  input\ninto  fields of fixed width, instead of using the value of the FS variable as the\nfield separator.  Each field width may optionally be preceded  by  a  colon-sepa‐\nrated  value specifying the number of characters to skip before the field starts.\nSee Fields, above.\n\nFILENAME    The name of the current input file.  If no files are  specified  on  the  command\nline,  the  value  of FILENAME is “-”.  However, FILENAME is undefined inside the\nBEGIN rule (unless set by getline).\n\nFNR         The input record number in the current input file.\n\nFPAT        A regular expression describing the contents of the fields  in  a  record.   When\nset,  gawk  parses  the input into fields, where the fields match the regular ex‐\npression, instead of using the value of FS as the field separator.   See  Fields,\nabove.\n\nFS          The input field separator, a space by default.  See Fields, above.\n\nFUNCTAB     An array whose indices and corresponding values are the names of all the user-de‐\nfined or extension functions in the program.  NOTE: You may not  use  the  delete\nstatement with the FUNCTAB array.\n\nIGNORECASE  Controls  the  case-sensitivity  of all regular expression and string operations.\nIf IGNORECASE has a non-zero value, then string comparisons and pattern  matching\nin  rules,  field  splitting with FS and FPAT, record separating with RS, regular\nexpression matching with ~ and !~, and the gensub(),  gsub(),  index(),  match(),\npatsplit(), split(), and sub() built-in functions all ignore case when doing reg‐\nular expression operations.  NOTE: Array subscripting is not affected.   However,\nthe asort() and asorti() functions are affected.\nThus,  if  IGNORECASE is not equal to zero, /aB/ matches all of the strings \"ab\",\n\"aB\", \"Ab\", and \"AB\".  As with all AWK variables, the initial value of IGNORECASE\nis zero, so all regular expression and string operations are normally case-sensi‐\ntive.\n\nLINT        Provides dynamic control of the --lint option from within an AWK  program.   When\ntrue, gawk prints lint warnings. When false, it does not.  The values allowed for\nthe --lint option may also be assigned to LINT, with the same effects.  Any other\ntrue value just prints warnings.\n\nNF          The number of fields in the current input record.\n\nNR          The total number of input records seen so far.\n\nOFMT        The output format for numbers, \"%.6g\", by default.\n\nOFS         The output field separator, a space by default.\n\nORS         The output record separator, by default a newline.\n\nPREC        The  working  precision  of arbitrary precision floating-point numbers, 53 by de‐\nfault.\n\nPROCINFO    The elements of this array provide access to information about  the  running  AWK\nprogram.   On  some systems, there may be elements in the array, \"group1\" through\n\"groupn\" for some n, which is the number of supplementary groups that the process\nhas.  Use the in operator to test for these elements.  The following elements are\nguaranteed to be available:\n\nPROCINFO[\"argv\"]     The command line arguments as received by gawk at the C-lan‐\nguage level.  The subscripts start from zero.\n\nPROCINFO[\"egid\"]     The value of the getegid(2) system call.\n\nPROCINFO[\"errno\"]    The  value  of  errno(3) when ERRNO is set to the associated\nerror message.\n\nPROCINFO[\"euid\"]     The value of the geteuid(2) system call.\n\nPROCINFO[\"FS\"]       \"FS\" if field splitting with FS  is  in  effect,  \"FPAT\"  if\nfield  splitting  with  FPAT  is in effect, \"FIELDWIDTHS\" if\nfield splitting with FIELDWIDTHS is in effect, or  \"API\"  if\nAPI input parser field splitting is in effect.\n\nPROCINFO[\"gid\"]      The value of the getgid(2) system call.\n\nPROCINFO[\"identifiers\"]\nA  subarray, indexed by the names of all identifiers used in\nthe text of the AWK program.  The values indicate what  gawk\nknows  about  the  identifiers after it has finished parsing\nthe program; they are not updated while  the  program  runs.\nFor  each identifier, the value of the element is one of the\nfollowing:\n\n\"array\"     The identifier is an array.\n\n\"builtin\"   The identifier is a built-in function.\n\n\"extension\" The identifier is an extension  function  loaded\nvia @load or --load.\n\n\"scalar\"    The identifier is a scalar.\n\n\"untyped\"   The  identifier  is  untyped (could be used as a\nscalar or array, gawk doesn't know yet).\n\n\"user\"      The identifier is a user-defined function.\n\nPROCINFO[\"pgrpid\"]   The value of the getpgrp(2) system call.\n\nPROCINFO[\"pid\"]      The value of the getpid(2) system call.\n\nPROCINFO[\"platform\"] A string indicating the platform for  which  gawk  was  com‐\npiled.  It is one of:\n\n\"djgpp\", \"mingw\"\nMicrosoft  Windows, using either DJGPP, or MinGW, re‐\nspectively.\n\n\"os2\"  OS/2.\n\n\"posix\"\nGNU/Linux, Cygwin, Mac OS X, and legacy Unix systems.\n\n\"vms\"  OpenVMS or Vax/VMS.\n\nPROCINFO[\"ppid\"]     The value of the getppid(2) system call.\n\nPROCINFO[\"strftime\"] The default time format string for strftime().  Changing its\nvalue affects how strftime() formats time values when called\nwith no arguments.\n\nPROCINFO[\"uid\"]      The value of the getuid(2) system call.\n\nPROCINFO[\"version\"]  The version of gawk.\n\nThe following elements are present if loading dynamic extensions is available:\n\nPROCINFO[\"apimajor\"]\nThe major version of the extension API.\n\nPROCINFO[\"apiminor\"]\nThe minor version of the extension API.\n\nThe following elements are available if MPFR support is compiled into gawk:\n\nPROCINFO[\"gmpversion\"]\nThe version of the GNU GMP library used  for  arbitrary  precision  number\nsupport in gawk.\n\nPROCINFO[\"mpfrversion\"]\nThe  version  of  the GNU MPFR library used for arbitrary precision number\nsupport in gawk.\n\nPROCINFO[\"precmax\"]\nThe maximum precision supported by the GNU MPFR library for arbitrary pre‐\ncision floating-point numbers.\n\nPROCINFO[\"precmin\"]\nThe minimum precision allowed by the GNU MPFR library for arbitrary preci‐\nsion floating-point numbers.\n\nThe following elements may set by a program to change gawk's behavior:\n\nPROCINFO[\"NONFATAL\"]\nIf this exists, then I/O errors for all redirections become nonfatal.\n\nPROCINFO[\"name\", \"NONFATAL\"]\nMake I/O errors for name be nonfatal.\n\nPROCINFO[\"command\", \"pty\"]\nUse a pseudo-tty for two-way communication with command instead of setting\nup two one-way pipes.\n\nPROCINFO[\"input\", \"READTIMEOUT\"]\nThe  timeout in milliseconds for reading data from input, where input is a\nredirection string or a filename. A value of zero or less than zero  means\nno timeout.\n\nPROCINFO[\"input\", \"RETRY\"]\nIf  an  I/O error that may be retried occurs when reading data from input,\nand this array entry exists, then getline returns -2 instead of  following\nthe  default  behavior  of returning -1 and configuring input to return no\nfurther data.  An I/O error that may be retried is one where errno(3)  has\nthe value EAGAIN, EWOULDBLOCK, EINTR, or ETIMEDOUT.  This may be useful in\nconjunction with PROCINFO[\"input\", \"READTIMEOUT\"] or in situations  where\na file descriptor has been configured to behave in a non-blocking fashion.\n\nPROCINFO[\"sortedin\"]\nIf  this  element exists in PROCINFO, then its value controls the order in\nwhich array elements are traversed in for  loops.   Supported  values  are\n\"@indstrasc\",     \"@indnumasc\",    \"@valtypeasc\",    \"@valstrasc\",\n\"@valnumasc\",   \"@indstrdesc\",   \"@indnumdesc\",    \"@valtypedesc\",\n\"@valstrdesc\",  \"@valnumdesc\", and \"@unsorted\".  The value can also be\nthe name (as a string) of any comparison function defined as follows:\n\nfunction cmpfunc(i1, v1, i2, v2)\n\nwhere i1 and i2 are the indices, and v1 and v2 are the corresponding  val‐\nues  of  the  two elements being compared.  It should return a number less\nthan, equal to, or greater than 0, depending on how the  elements  of  the\narray are to be ordered.\n\nROUNDMODE   The  rounding  mode  to use for arbitrary precision arithmetic on numbers, by de‐\nfault \"N\" (IEEE-754 roundTiesToEven mode).  The accepted values are:\n\n\"A\" or \"a\"\nfor rounding away from zero.  These are only available if your version  of\nthe GNU MPFR library supports rounding away from zero.\n\n\"D\" or \"d\" for roundTowardNegative.\n\n\"N\" or \"n\" for roundTiesToEven.\n\n\"U\" or \"u\" for roundTowardPositive.\n\n\"Z\" or \"z\" for roundTowardZero.\n\nRS          The input record separator, by default a newline.\n\nRT          The record terminator.  Gawk sets RT to the input text that matched the character\nor regular expression specified by RS.\n\nRSTART      The index of the first character matched by match(); 0 if no  match.   (This  im‐\nplies that character indices start at one.)\n\nRLENGTH     The length of the string matched by match(); -1 if no match.\n\nSUBSEP      The  string  used  to  separate multiple subscripts in array elements, by default\n\"\\034\".\n\nSYMTAB      An array whose indices are the names of all currently  defined  global  variables\nand  arrays in the program.  The array may be used for indirect access to read or\nwrite the value of a variable:\n\nfoo = 5\nSYMTAB[\"foo\"] = 4\nprint foo    # prints 4\n\nThe typeof() function may be used to test if an element in SYMTAB  is  an  array.\nYou  may  not  use the delete statement with the SYMTAB array, nor assign to ele‐\nments with an index that is not a variable name.\n\nTEXTDOMAIN  The text domain of the AWK program; used to find the localized  translations  for\nthe program's strings.\n"
                },
                {
                    "name": "Arrays",
                    "content": "Arrays  are subscripted with an expression between square brackets ([ and ]).  If the expres‐\nsion is an expression list (expr, expr ...)  then the array subscript is a string  consisting\nof  the concatenation of the (string) value of each expression, separated by the value of the\nSUBSEP variable.  This facility is used to simulate multiply dimensioned arrays.   For  exam‐\nple:\n\ni = \"A\"; j = \"B\"; k = \"C\"\nx[i, j, k] = \"hello, world\\n\"\n\nassigns  the  string  \"hello, world\\n\"  to the element of the array x which is indexed by the\nstring \"A\\034B\\034C\".  All arrays in AWK are associative, i.e., indexed by string values.\n\nThe special operator in may be used to test if an array has an index consisting of a particu‐\nlar value:\n\nif (val in array)\nprint array[val]\n\nIf the array has multiple subscripts, use (i, j) in array.\n\nThe in construct may also be used in a for loop to iterate over all the elements of an array.\nHowever, the (i, j) in array construct only works in tests, not in for loops.\n\nAn element may be deleted from an array using the delete statement.  The delete statement may\nalso  be  used  to  delete the entire contents of an array, just by specifying the array name\nwithout a subscript.\n\ngawk supports true multidimensional arrays. It does not require that such arrays be ``rectan‐\ngular'' as in C or C++.  For example:\n\na[1] = 5\na[2][1] = 6\na[2][2] = 7\n\nNOTE: You may need to tell gawk that an array element is really a subarray in order to use it\nwhere gawk expects an array (such as in the second argument to split()).  You can do this  by\ncreating an element in the subarray and then deleting it with the delete statement.\n"
                },
                {
                    "name": "Namespaces",
                    "content": "Gawk  provides a simple namespace facility to help work around the fact that all variables in\nAWK are global.\n\nA qualified name consists of a two simple identifiers joined by a  double  colon  (::).   The\nleft-hand  identifier  represents the namespace and the right-hand identifier is the variable\nwithin it.  All simple (non-qualified) names are considered to be in  the  ``current''  name‐\nspace; the default namespace is awk.  However, simple identifiers consisting solely of upper‐\ncase letters are forced into the awk namespace, even if the current namespace is different.\n\nYou change the current namespace with an @namespace \"name\" directive.\n\nThe standard predefined builtin function names may not be used as namespace names.  The names\nof  additional functions provided by gawk may be used as namespace names or as simple identi‐\nfiers in other namespaces.  For more details, see GAWK: Effective AWK Programming.\n"
                },
                {
                    "name": "Variable Typing And Conversion",
                    "content": "Variables and fields may be (floating point) numbers, or strings, or both.  They may also  be\nregular expressions. How the value of a variable is interpreted depends upon its context.  If\nused in a numeric expression, it will be treated as a number; if used as a string it will  be\ntreated as a string.\n\nTo force a variable to be treated as a number, add zero to it; to force it to be treated as a\nstring, concatenate it with the null string.\n\nUninitialized variables have the numeric value zero and the string value  \"\"  (the  null,  or\nempty, string).\n\nWhen  a string must be converted to a number, the conversion is accomplished using strtod(3).\nA number is converted to a string by using the value  of  CONVFMT  as  a  format  string  for\nsprintf(3), with the numeric value of the variable as the argument.  However, even though all\nnumbers in AWK are floating-point, integral values are always converted as  integers.   Thus,\ngiven\n\nCONVFMT = \"%2.2f\"\na = 12\nb = a \"\"\n\nthe variable b has a string value of \"12\" and not \"12.00\".\n\nNOTE: When operating in POSIX mode (such as with the --posix option), beware that locale set‐\ntings may interfere with the way decimal numbers are treated: the decimal  separator  of  the\nnumbers  you are feeding to gawk must conform to what your locale would expect, be it a comma\n(,) or a period (.).\n\nGawk performs comparisons as follows: If two variables are numeric, they are compared numeri‐\ncally.   If one value is numeric and the other has a string value that is a “numeric string,”\nthen comparisons are also done numerically.  Otherwise, the numeric value is converted  to  a\nstring  and  a  string  comparison  is  performed.   Two  strings are compared, of course, as\nstrings.\n\nNote that string constants, such as \"57\", are not numeric strings, they are string constants.\nThe  idea of “numeric string” only applies to fields, getline input, FILENAME, ARGV elements,\nENVIRON elements and the elements of an array created by split() or patsplit() that  are  nu‐\nmeric  strings.   The basic idea is that user input, and only user input, that looks numeric,\nshould be treated that way.\n"
                },
                {
                    "name": "Octal and Hexadecimal Constants",
                    "content": "You may use C-style octal and hexadecimal constants in your AWK program source code.  For ex‐\nample,  the octal value 011 is equal to decimal 9, and the hexadecimal value 0x11 is equal to\ndecimal 17.\n"
                },
                {
                    "name": "String Constants",
                    "content": "String constants in AWK are sequences of characters  enclosed  between  double  quotes  (like\n\"value\").  Within strings, certain escape sequences are recognized, as in C.  These are:\n\n\\\\   A literal backslash.\n\n\\a   The “alert” character; usually the ASCII BEL character.\n\n\\b   Backspace.\n\n\\f   Form-feed.\n\n\\n   Newline.\n\n\\r   Carriage return.\n\n\\t   Horizontal tab.\n\n\\v   Vertical tab.\n\n\\xhex digits\nThe  character  represented by the string of hexadecimal digits following the \\x.  Up to\ntwo following hexadecimal digits are considered part  of  the  escape  sequence.   E.g.,\n\"\\x1B\" is the ASCII ESC (escape) character.\n\n\\ddd The  character  represented  by  the 1-, 2-, or 3-digit sequence of octal digits.  E.g.,\n\"\\033\" is the ASCII ESC (escape) character.\n\n\\c   The literal character c.\n\nIn compatibility mode, the characters represented by octal and hexadecimal  escape  sequences\nare treated literally when used in regular expression constants.  Thus, /a\\52b/ is equivalent\nto /a\\*b/.\n"
                },
                {
                    "name": "Regexp Constants",
                    "content": "A regular expression constant is a sequence of characters enclosed  between  forward  slashes\n(like  /value/).   Regular expression matching is described more fully below; see Regular Ex‐‐\npressions.\n\nThe escape sequences described earlier may also be used inside constant  regular  expressions\n(e.g., /[ \\t\\f\\n\\r\\v]/ matches whitespace characters).\n\nGawk provides strongly typed regular expression constants. These are written with a leading @\nsymbol (like so: @/value/).  Such constants may be assigned to scalars (variables, array ele‐\nments)  and passed to user-defined functions. Variables that have been so assigned have regu‐\nlar expression type.\n"
                }
            ]
        },
        "PATTERNS AND ACTIONS": {
            "content": "AWK is a line-oriented language.  The pattern comes  first,  and  then  the  action.   Action\nstatements  are enclosed in { and }.  Either the pattern may be missing, or the action may be\nmissing, but, of course, not both.  If the pattern is missing, the action executes for  every\nsingle record of input.  A missing action is equivalent to\n\n{ print }\n\nwhich prints the entire record.\n\nComments begin with the # character, and continue until the end of the line.  Empty lines may\nbe used to separate statements.  Normally, a statement ends with a newline, however, this  is\nnot  the  case  for  lines ending in a comma, {, ?, :, &&, or ||.  Lines ending in do or else\nalso have their statements automatically continued on the following line.  In other cases,  a\nline  can  be  continued by ending it with a “\\”, in which case the newline is ignored.  How‐\never, a “\\” after a # is not special.\n\nMultiple statements may be put on one line by separating them with a “;”.   This  applies  to\nboth  the statements within the action part of a pattern-action pair (the usual case), and to\nthe pattern-action statements themselves.\n",
            "subsections": [
                {
                    "name": "Patterns",
                    "content": "AWK patterns may be one of the following:\n\nBEGIN\nEND\nBEGINFILE\nENDFILE\n/regular expression/\nrelational expression\npattern && pattern\npattern || pattern\npattern ? pattern : pattern\n(pattern)\n! pattern\npattern1, pattern2\n\nBEGIN and END are two special kinds of patterns which are not tested against the input.   The\naction  parts of all BEGIN patterns are merged as if all the statements had been written in a\nsingle BEGIN rule.  They are executed before any of the input is read.   Similarly,  all  the\nEND rules are merged, and executed when all the input is exhausted (or when an exit statement\nis executed).  BEGIN and END patterns cannot be combined with other patterns in  pattern  ex‐\npressions.  BEGIN and END patterns cannot have missing action parts.\n\nBEGINFILE and ENDFILE are additional special patterns whose actions are executed before read‐\ning the first record of each command-line input file and after reading  the  last  record  of\neach file.  Inside the BEGINFILE rule, the value of ERRNO is the empty string if the file was\nopened successfully.  Otherwise, there is some problem with the file and the code should  use\nnextfile  to skip it. If that is not done, gawk produces its usual fatal error for files that\ncannot be opened.\n\nFor /regular expression/ patterns, the associated statement is executed for each input record\nthat  matches the regular expression.  Regular expressions are the same as those in egrep(1),\nand are summarized below.\n\nA relational expression may use any of the operators defined below in the section on actions.\nThese generally test whether certain fields match certain regular expressions.\n\nThe  &&,  ||, and !  operators are logical AND, logical OR, and logical NOT, respectively, as\nin C.  They do short-circuit evaluation, also as in C, and are used for combining more primi‐\ntive  pattern expressions.  As in most languages, parentheses may be used to change the order\nof evaluation.\n\nThe ?: operator is like the same operator in C.  If the first pattern is true then  the  pat‐\ntern used for testing is the second pattern, otherwise it is the third.  Only one of the sec‐\nond and third patterns is evaluated.\n\nThe pattern1, pattern2 form of an expression is called a range pattern.  It matches all input\nrecords  starting  with  a  record  that matches pattern1, and continuing until a record that\nmatches pattern2, inclusive.  It does not combine with any other sort of pattern expression.\n"
                },
                {
                    "name": "Regular Expressions",
                    "content": "Regular expressions are the extended kind found in egrep.  They are composed of characters as\nfollows:\n\nc          Matches the non-metacharacter c.\n\n\\c         Matches the literal character c.\n\n.          Matches any character including newline.\n\n^          Matches the beginning of a string.\n\n$          Matches the end of a string.\n\n[abc...]   A  character  list: matches any of the characters abc....  You may include a range\nof characters by separating them with a dash.  To include a literal  dash  in  the\nlist, put it first or last.\n\n[^abc...]  A negated character list: matches any character except abc....\n\nr1|r2      Alternation: matches either r1 or r2.\n\nr1r2       Concatenation: matches r1, and then r2.\n\nr+         Matches one or more r's.\n\nr*         Matches zero or more r's.\n\nr?         Matches zero or one r's.\n\n(r)        Grouping: matches r.\n\nr{n}\nr{n,}\nr{n,m}     One  or  two numbers inside braces denote an interval expression.  If there is one\nnumber in the braces, the preceding regular expression r is repeated n times.   If\nthere  are two numbers separated by a comma, r is repeated n to m times.  If there\nis one number followed by a comma, then r is repeated at least n times.\n\n\\y         Matches the empty string at either the beginning or the end of a word.\n\n\\B         Matches the empty string within a word.\n\n\\<         Matches the empty string at the beginning of a word.\n\n\\>         Matches the empty string at the end of a word.\n\n\\s         Matches any whitespace character.\n\n\\S         Matches any nonwhitespace character.\n\n\\w         Matches any word-constituent character (letter, digit, or underscore).\n\n\\W         Matches any character that is not word-constituent.\n\n\\`         Matches the empty string at the beginning of a buffer (string).\n\n\\'         Matches the empty string at the end of a buffer.\n\nThe escape sequences that are valid in string constants (see String Constants) are also valid\nin regular expressions.\n\nCharacter  classes  are  a  feature introduced in the POSIX standard.  A character class is a\nspecial notation for describing lists of characters that have a specific attribute, but where\nthe  actual  characters themselves can vary from country to country and/or from character set\nto character set.  For example, the notion of what is an alphabetic character differs in  the\nUSA and in France.\n\nA  character  class  is only valid in a regular expression inside the brackets of a character\nlist.  Character classes consist of [:, a keyword denoting the class, and :].  The  character\nclasses defined by the POSIX standard are:\n\n[:alnum:]  Alphanumeric characters.\n\n[:alpha:]  Alphabetic characters.\n\n[:blank:]  Space or tab characters.\n\n[:cntrl:]  Control characters.\n\n[:digit:]  Numeric characters.\n\n[:graph:]  Characters  that  are  both printable and visible.  (A space is printable, but not\nvisible, while an a is both.)\n\n[:lower:]  Lowercase alphabetic characters.\n\n[:print:]  Printable characters (characters that are not control characters.)\n\n[:punct:]  Punctuation characters (characters that are not letter,  digits,  control  charac‐\nters, or space characters).\n\n[:space:]  Space characters (such as space, tab, and formfeed, to name a few).\n\n[:upper:]  Uppercase alphabetic characters.\n\n[:xdigit:] Characters that are hexadecimal digits.\n\nFor  example, before the POSIX standard, to match alphanumeric characters, you would have had\nto write /[A-Za-z0-9]/.  If your character set had other alphabetic characters  in  it,  this\nwould  not  match them, and if your character set collated differently from ASCII, this might\nnot even match the ASCII alphanumeric characters.  With the POSIX character classes, you  can\nwrite /[[:alnum:]]/, and this matches the alphabetic and numeric characters in your character\nset, no matter what it is.\n\nTwo additional special sequences can appear in character lists.   These  apply  to  non-ASCII\ncharacter  sets,  which  can  have single symbols (called collating elements) that are repre‐\nsented with more than one character, as well as several characters that  are  equivalent  for\ncollating,  or sorting, purposes.  (E.g., in French, a plain “e” and a grave-accented “`” are\nequivalent.)\n\nCollating Symbols\nA collating symbol is a multi-character collating element enclosed in [.  and .].  For\nexample,  if  ch  is  a collating element, then [[.ch.]]  is a regular expression that\nmatches this collating element, while [ch] is a regular expression that matches either\nc or h.\n\nEquivalence Classes\nAn  equivalence  class  is  a  locale-specific  name for a list of characters that are\nequivalent.  The name is enclosed in [= and =].  For example, the name e might be used\nto  represent all of “e”, “e´”, and “`”.  In this case, [[=e=]] is a regular expression\nthat matches any of e, e´´, or `.\n\nThese features are very valuable in non-English speaking locales.  The library functions that\ngawk  uses  for regular expression matching currently only recognize POSIX character classes;\nthey do not recognize collating symbols or equivalence classes.\n\nThe \\y, \\B, \\<, \\>, \\s, \\S, \\w, \\W, \\`, and \\' operators are specific to gawk; they  are  ex‐\ntensions based on facilities in the GNU regular expression libraries.\n\nThe  various  command  line options control how gawk interprets characters in regular expres‐\nsions.\n\nNo options\nIn the default case, gawk provides all the facilities of POSIX regular expressions and\nthe GNU regular expression operators described above.\n"
                },
                {
                    "name": "--posix",
                    "content": "Only  POSIX  regular  expressions  are  supported,  the GNU operators are not special.\n(E.g., \\w matches a literal w).\n",
                    "long": "--posix"
                },
                {
                    "name": "--traditional",
                    "content": "Traditional UNIX awk regular expressions are matched.  The GNU operators are not  spe‐\ncial,  and  interval expressions are not available.  Characters described by octal and\nhexadecimal escape sequences are treated literally, even if they represent regular ex‐\npression metacharacters.\n",
                    "long": "--traditional"
                },
                {
                    "name": "--re-interval",
                    "content": "Allow interval expressions in regular expressions, even if --traditional has been pro‐\nvided.\n",
                    "long": "--re-interval"
                },
                {
                    "name": "Actions",
                    "content": "Action statements are enclosed in braces, { and }.  Action statements consist  of  the  usual\nassignment, conditional, and looping statements found in most languages.  The operators, con‐\ntrol statements, and input/output statements available are patterned after those in C.\n"
                },
                {
                    "name": "Operators",
                    "content": "The operators in AWK, in order of decreasing precedence, are:\n\n(...)       Grouping\n\n$           Field reference.\n\n++ --       Increment and decrement, both prefix and postfix.\n\n^           Exponentiation ( may also be used, and = for the assignment operator).\n\n+ - !       Unary plus, unary minus, and logical negation.\n\n* / %       Multiplication, division, and modulus.\n\n+ -         Addition and subtraction.\n\nspace       String concatenation.\n\n|   |&      Piped I/O for getline, print, and printf.\n"
                },
                {
                    "name": "< > <= >= == !=",
                    "content": "The regular relational operators.\n\n~ !~        Regular expression match, negated match.  NOTE: Do not use a constant regular ex‐\npression  (/foo/) on the left-hand side of a ~ or !~.  Only use one on the right-\nhand side.  The expression /foo/ ~ exp has the same meaning as (($0  ~  /foo/)  ~\nexp).  This is usually not what you want.\n\nin          Array membership.\n\n&&          Logical AND.\n\n||          Logical OR.\n\n?:          The C conditional expression.  This has the form expr1 ? expr2 : expr3.  If expr1\nis true, the value of the expression is expr2, otherwise it is expr3.   Only  one\nof expr2 and expr3 is evaluated.\n\n= += -= *= /= %= ^=\nAssignment.   Both absolute assignment (var = value) and operator-assignment (the\nother forms) are supported.\n"
                },
                {
                    "name": "Control Statements",
                    "content": "The control statements are as follows:\n\nif (condition) statement [ else statement ]\nwhile (condition) statement\ndo statement while (condition)\nfor (expr1; expr2; expr3) statement\nfor (var in array) statement\nbreak\ncontinue\ndelete array[index]\ndelete array\nexit [ expression ]\n{ statements }\nswitch (expression) {\ncase value|regex : statement\n...\n[ default: statement ]\n}\n"
                },
                {
                    "name": "I/O Statements",
                    "content": "The input/output statements are as follows:\n\nclose(file [, how])   Close file, pipe or coprocess.  The optional how should  only  be  used\nwhen  closing  one  end of a two-way pipe to a coprocess.  It must be a\nstring value, either \"to\" or \"from\".\n\ngetline               Set $0 from the next input record; set NF, NR, FNR, RT.\n\ngetline <file         Set $0 from the next record of file; set NF, RT.\n\ngetline var           Set var from the next input record; set NR, FNR, RT.\n\ngetline var <file     Set var from the next record of file; set RT.\n\ncommand | getline [var]\nRun command, piping the output either into $0 or var, as above, and RT.\n\ncommand |& getline [var]\nRun command as a coprocess piping the output either into $0 or var,  as\nabove,  and  RT.   Coprocesses  are a gawk extension.  (The command can\nalso be a socket.  See the subsection Special File Names, below.)\n\nnext                  Stop processing the current input record.  Read the next  input  record\nand  start  processing  over with the first pattern in the AWK program.\nUpon reaching the end of the input data, execute any END rule(s).\n\nnextfile              Stop processing the current input file.  The  next  input  record  read\ncomes  from the next input file.  Update FILENAME and ARGIND, reset FNR\nto 1, and start processing over with the first pattern in the AWK  pro‐\ngram.  Upon reaching the end of the input data, execute any ENDFILE and\nEND rule(s).\n\nprint                 Print the current record.  The output record  is  terminated  with  the\nvalue of ORS.\n\nprint expr-list       Print  expressions.   Each expression is separated by the value of OFS.\nThe output record is terminated with the value of ORS.\n\nprint expr-list >file Print expressions on file.  Each expression is separated by  the  value\nof OFS.  The output record is terminated with the value of ORS.\n\nprintf fmt, expr-list Format and print.  See The printf Statement, below.\n\nprintf fmt, expr-list >file\nFormat and print on file.\n\nsystem(cmd-line)      Execute  the  command  cmd-line, and return the exit status.  (This may\nnot be available on non-POSIX systems.)  See GAWK: Effective  AWK  Pro‐\ngramming for the full details on the exit status.\n\nfflush([file])        Flush  any  buffers  associated with the open output file or pipe file.\nIf file is missing or if it is the null string,  then  flush  all  open\noutput files and pipes.\n\nAdditional output redirections are allowed for print and printf.\n\nprint ... >> file\nAppend output to the file.\n\nprint ... | command\nWrite on a pipe.\n\nprint ... |& command\nSend  data to a coprocess or socket.  (See also the subsection Special File Names, be‐\nlow.)\n\nThe getline command returns 1 on success, zero on end of file, and -1 on an  error.   If  the\nerrno(3)  value  indicates  that  the  I/O  operation  may  be retried, and PROCINFO[\"input\",\n\"RETRY\"] is set, then -2 is returned instead of -1, and further calls to getline may  be  at‐\ntempted.  Upon an error, ERRNO is set to a string describing the problem.\n\nNOTE:  Failure in opening a two-way socket results in a non-fatal error being returned to the\ncalling function. If using a pipe, coprocess, or socket to getline, or from print  or  printf\nwithin  a  loop,  you must use close() to create new instances of the command or socket.  AWK\ndoes not automatically close pipes, sockets, or coprocesses when they return EOF.\n\nThe printf Statement\nThe AWK versions of the printf statement and sprintf() function (see below) accept  the  fol‐\nlowing conversion specification formats:\n\n%a, %A  A  floating point number of the form [-]0xh.hhhhp+-dd (C99 hexadecimal floating point\nformat).  For %A, uppercase letters are used instead of lowercase ones.\n\n%c      A single character.  If the argument used for %c is numeric, it is treated as a char‐\nacter  and  printed.  Otherwise, the argument is assumed to be a string, and the only\nfirst character of that string is printed.\n\n%d, %i  A decimal number (the integer part).\n\n%e, %E  A floating point number of the form [-]d.dddddde[+-]dd.  The %E format uses E instead\nof e.\n\n%f, %F  A  floating  point  number of the form [-]ddd.dddddd.  If the system library supports\nit, %F is available as well. This is like %f, but uses capital  letters  for  special\n“not a number” and “infinity” values. If %F is not available, gawk uses %f.\n\n%g, %G  Use  %e or %f conversion, whichever is shorter, with nonsignificant zeros suppressed.\nThe %G format uses %E instead of %e.\n\n%o      An unsigned octal number (also an integer).\n\n%u      An unsigned decimal number (again, an integer).\n\n%s      A character string.\n\n%x, %X  An unsigned hexadecimal number (an integer).  The %X format uses  ABCDEF  instead  of\nabcdef.\n\n%%      A single % character; no argument is converted.\n\nOptional, additional parameters may lie between the % and the control letter:\n\ncount$ Use  the  count'th  argument  at this point in the formatting.  This is called a posi‐\ntional specifier and is intended primarily for use in translated  versions  of  format\nstrings, not in the original text of an AWK program.  It is a gawk extension.\n\n-      The expression should be left-justified within its field.\n\nspace  For numeric conversions, prefix positive values with a space, and negative values with\na minus sign.\n\n+      The plus sign, used before the width modifier (see below), says  to  always  supply  a\nsign  for  numeric  conversions,  even if the data to be formatted is positive.  The +\noverrides the space modifier.\n\n#      Use an “alternate form” for certain control letters.  For %o, supply a  leading  zero.\nFor  %x,  and  %X, supply a leading 0x or 0X for a nonzero result.  For %e, %E, %f and\n%F, the result always contains a decimal point.  For %g, and %G,  trailing  zeros  are\nnot removed from the result.\n\n0      A leading 0 (zero) acts as a flag, indicating that output should be padded with zeroes\ninstead of spaces.  This applies only to the numeric output formats.  This  flag  only\nhas an effect when the field width is wider than the value to be printed.\n\n'      A  single  quote  character  instructs gawk to insert the locale's thousands-separator\ncharacter into decimal numbers, and to also use the locale's decimal  point  character\nwith  floating  point  formats.  This requires correct locale support in the C library\nand in the definition of the current locale.\n\nwidth  The field should be padded to this width.  The field is normally padded  with  spaces.\nWith the 0 flag, it is padded with zeroes.\n\n.prec  A  number  that  specifies the precision to use when printing.  For the %e, %E, %f and\n%F, formats, this specifies the number of digits you want printed to the right of  the\ndecimal point.  For the %g, and %G formats, it specifies the maximum number of signif‐\nicant digits.  For the %d, %i, %o, %u, %x, and %X formats, it  specifies  the  minimum\nnumber  of  digits  to  print.   For the %s format, it specifies the maximum number of\ncharacters from the string that should be printed.\n\nThe dynamic width and prec capabilities of the ISO C printf() routines are supported.  A * in\nplace of either the width or prec specifications causes their values to be taken from the ar‐\ngument list to printf or sprintf().  To use a positional specifier with a  dynamic  width  or\nprecision, supply the count$ after the * in the format string.  For example, \"%3$*2$.*1$s\".\n"
                },
                {
                    "name": "Special File Names",
                    "content": "When  doing  I/O  redirection  from either print or printf into a file, or via getline from a\nfile, gawk recognizes certain special filenames internally.  These filenames allow access  to\nopen  file  descriptors inherited from gawk's parent process (usually the shell).  These file\nnames may also be used on the command line to name data files.  The filenames are:\n\n-           The standard input.\n\n/dev/stdin  The standard input.\n\n/dev/stdout The standard output.\n\n/dev/stderr The standard error output.\n\n/dev/fd/n   The file associated with the open file descriptor n.\n\nThese are particularly useful for error messages.  For example:\n\nprint \"You blew it!\" > \"/dev/stderr\"\n\nwhereas you would otherwise have to use\n\nprint \"You blew it!\" | \"cat 1>&2\"\n\nThe following special filenames may be used with  the  |&  coprocess  operator  for  creating\nTCP/IP network connections:\n\n/inet/tcp/lport/rhost/rport\n/inet4/tcp/lport/rhost/rport\n/inet6/tcp/lport/rhost/rport\nFiles  for a TCP/IP connection on local port lport to remote host rhost on remote port\nrport.  Use a port of 0 to have the system pick a port.  Use /inet4 to force  an  IPv4\nconnection,  and  /inet6 to force an IPv6 connection.  Plain /inet uses the system de‐\nfault (most likely IPv4).  Usable only with the |& two-way I/O operator.\n\n/inet/udp/lport/rhost/rport\n/inet4/udp/lport/rhost/rport\n/inet6/udp/lport/rhost/rport\nSimilar, but use UDP/IP instead of TCP/IP.\n"
                },
                {
                    "name": "Numeric Functions",
                    "content": "AWK has the following built-in arithmetic functions:\n\natan2(y, x)   Return the arctangent of y/x in radians.\n\ncos(expr)     Return the cosine of expr, which is in radians.\n\nexp(expr)     The exponential function.\n\nint(expr)     Truncate to integer.\n\nlog(expr)     The natural logarithm function.\n\nrand()        Return a random number N, between zero and one, such that 0 ≤ N < 1.\n\nsin(expr)     Return the sine of expr, which is in radians.\n\nsqrt(expr)    Return the square root of expr.\n\nsrand([expr]) Use expr as the new seed for the random number generator.  If no expr  is  pro‐\nvided,  use  the  time  of day.  Return the previous seed for the random number\ngenerator.\n"
                },
                {
                    "name": "String Functions",
                    "content": "Gawk has the following built-in string functions:\n\nasort(s [, d [, how] ]) Return the number of elements in the source array s.  Sort  the  con‐\ntents  of  s  using gawk's normal rules for comparing values, and re‐\nplace the indices of the sorted values  s  with  sequential  integers\nstarting  with  1.  If the optional destination array d is specified,\nfirst duplicate s into d, and then sort d, leaving the indices of the\nsource array s unchanged. The optional string how controls the direc‐\ntion and the comparison mode.  Valid values for how are  any  of  the\nstrings  valid for PROCINFO[\"sortedin\"].  It can also be the name of\na    user-defined    comparison    function    as    described     in\nPROCINFO[\"sortedin\"].\n\nasorti(s [, d [, how] ])\nReturn the number of elements in the source array s.  The behavior is\nthe same as that of asort(), except that the array indices  are  used\nfor  sorting,  not the array values.  When done, the array is indexed\nnumerically, and the values are those of the original  indices.   The\noriginal  values are lost; thus provide a second array if you wish to\npreserve the original.  The purpose of the optional string how is the\nsame as described previously for asort().\n\ngensub(r, s, h [, t])   Search  the  target string t for matches of the regular expression r.\nIf h is a string beginning with g or G, then replace all matches of r\nwith  s.  Otherwise, h is a number indicating which match of r to re‐\nplace.  If t is not supplied, use $0 instead.  Within the replacement\ntext  s, the sequence \\n, where n is a digit from 1 to 9, may be used\nto indicate just the text that matched the n'th parenthesized  subex‐\npression.   The  sequence  \\0  represents the entire matched text, as\ndoes the character &.  Unlike sub() and gsub(), the  modified  string\nis  returned  as  the result of the function, and the original target\nstring is not changed.\n\ngsub(r, s [, t])        For each substring matching the regular expression r in the string t,\nsubstitute  the string s, and return the number of substitutions.  If\nt is not supplied, use $0.  An & in the replacement text is  replaced\nwith  the text that was actually matched.  Use \\& to get a literal &.\n(This must be typed as \"\\\\&\"; see GAWK: Effective AWK Programming for\na  fuller  discussion  of the rules for ampersands and backslashes in\nthe replacement text of sub(), gsub(), and gensub().)\n\nindex(s, t)             Return the index of the string t in the string s, or zero if t is not\npresent.   (This implies that character indices start at one.)  It is\na fatal error to use a regexp constant for t.\n\nlength([s])             Return the length of the string s, or the length of $0 if  s  is  not\nsupplied.   As  a  non-standard  extension,  with  an array argument,\nlength() returns the number of elements in the array.\n\nmatch(s, r [, a])       Return the position in s where the regular expression  r  occurs,  or\nzero  if  r is not present, and set the values of RSTART and RLENGTH.\nNote that the argument order is the same as for the ~ operator: str ~\nre.  If array a is provided, a is cleared and then elements 1 through\nn are filled with the portions of  s  that  match  the  corresponding\nparenthesized  subexpression in r.  The zero'th element of a contains\nthe portion of s matched by the entire regular  expression  r.   Sub‐\nscripts  a[n, \"start\"], and a[n, \"length\"] provide the starting index\nin the string and length respectively, of each matching substring.\n\npatsplit(s, a [, r [, seps] ])\nSplit the string s into the array a and the separators array seps  on\nthe  regular  expression r, and return the number of fields.  Element\nvalues are the portions of s that matched r.  The value of seps[i] is\nthe  possibly  null separator that appeared after a[i].  The value of\nseps[0] is the possibly null leading separator.   If  r  is  omitted,\nFPAT  is  used  instead.   The  arrays  a and seps are cleared first.\nSplitting behaves identically to field splitting with FPAT, described\nabove.\n\nsplit(s, a [, r [, seps] ])\nSplit  the string s into the array a and the separators array seps on\nthe regular expression r, and return the number of fields.  If  r  is\nomitted,  FS  is  used  instead.   The  arrays a and seps are cleared\nfirst.  seps[i] is the field separator matched by r between a[i]  and\na[i+1].   If  r  is a single space, then leading whitespace in s goes\ninto the extra array element seps[0]  and  trailing  whitespace  goes\ninto  the extra array element seps[n], where n is the return value of\nsplit(s, a, r, seps).  Splitting behaves identically to field  split‐\nting,  described  above.   In  particular, if r is a single-character\nstring, that string acts as the separator, even if it happens to be a\nregular expression metacharacter.\n\nsprintf(fmt, expr-list) Print expr-list according to fmt, and return the resulting string.\n\nstrtonum(str)           Examine  str,  and  return  its  numeric value.  If str begins with a\nleading 0, treat it as an octal number.  If str begins with a leading\n0x  or 0X, treat it as a hexadecimal number.  Otherwise, assume it is\na decimal number.\n\nsub(r, s [, t])         Just like gsub(), but replace only the first matching substring.  Re‐\nturn either zero or one.\n\nsubstr(s, i [, n])      Return the at most n-character substring of s starting at i.  If n is\nomitted, use the rest of s.\n\ntolower(str)            Return a copy of the string str, with all the uppercase characters in\nstr  translated  to their corresponding lowercase counterparts.  Non-\nalphabetic characters are left unchanged.\n\ntoupper(str)            Return a copy of the string str, with all the lowercase characters in\nstr  translated  to their corresponding uppercase counterparts.  Non-\nalphabetic characters are left unchanged.\n\nGawk is multibyte aware.  This means that index(), length(), substr() and match() all work in\nterms of characters, not bytes.\n"
                },
                {
                    "name": "Time Functions",
                    "content": "Since one of the primary uses of AWK programs is processing log files that contain time stamp\ninformation, gawk provides the following functions for obtaining time stamps  and  formatting\nthem.\n\nmktime(datespec [, utc-flag])\nTurn  datespec into a time stamp of the same form as returned by systime(), and re‐\nturn the result.  The datespec is a string of the form YYYY MM DD HH MM  SS[  DST].\nThe  contents  of the string are six or seven numbers representing respectively the\nfull year including century, the month from 1 to 12, the day of the month from 1 to\n31, the hour of the day from 0 to 23, the minute from 0 to 59, the second from 0 to\n60, and an optional daylight saving flag.  The values of these numbers need not  be\nwithin  the  ranges  specified; for example, an hour of -1 means 1 hour before mid‐\nnight.  The origin-zero Gregorian calendar is assumed, with year 0 preceding year 1\nand  year -1 preceding year 0.  If utc-flag is present and is non-zero or non-null,\nthe time is assumed to be in the UTC time zone; otherwise, the time is  assumed  to\nbe  in  the local time zone.  If the DST daylight saving flag is positive, the time\nis assumed to be daylight saving time; if zero, the time is assumed to be  standard\ntime;  and  if  negative (the default), mktime() attempts to determine whether day‐\nlight saving time is in effect for the specified time.  If datespec does  not  con‐\ntain enough elements or if the resulting time is out of range, mktime() returns -1.\n\nstrftime([format [, timestamp[, utc-flag]]])\nFormat  timestamp according to the specification in format.  If utc-flag is present\nand is non-zero or non-null, the result is in UTC, otherwise the result is in local\ntime.  The timestamp should be of the same form as returned by systime().  If time‐\nstamp is missing, the current time of day is used.  If format is missing, a default\nformat  equivalent  to the output of date(1) is used.  The default format is avail‐\nable in PROCINFO[\"strftime\"].  See the specification for the strftime() function in\nISO C for the format conversions that are guaranteed to be available.\n\nsystime() Return the current time of day as the number of seconds since the Epoch (1970-01-01\n00:00:00 UTC on POSIX systems).\n"
                },
                {
                    "name": "Bit Manipulations Functions",
                    "content": "Gawk supplies the following bit manipulation functions.  They work by converting  double-pre‐\ncision  floating point values to uintmaxt integers, doing the operation, and then converting\nthe result back to floating point.\n\nNOTE: Passing negative operands to any of these functions causes a fatal error.\n\nThe functions are:\n\nand(v1, v2 [, ...]) Return the bitwise AND of the  values  provided  in  the  argument  list.\nThere must be at least two.\n\ncompl(val)          Return the bitwise complement of val.\n\nlshift(val, count)  Return the value of val, shifted left by count bits.\n\nor(v1, v2 [, ...])  Return the bitwise OR of the values provided in the argument list.  There\nmust be at least two.\n\nrshift(val, count)  Return the value of val, shifted right by count bits.\n\nxor(v1, v2 [, ...]) Return the bitwise XOR of the  values  provided  in  the  argument  list.\nThere must be at least two.\n"
                },
                {
                    "name": "Type Functions",
                    "content": "The following functions provide type related information about their arguments.\n\nisarray(x) Return  true  if  x is an array, false otherwise.  This function is mainly for use\nwith the elements of multidimensional arrays and with function parameters.\n\ntypeof(x)  Return a string indicating the type of x.  The string  will  be  one  of  \"array\",\n\"number\", \"regexp\", \"string\", \"strnum\", \"unassigned\", or \"undefined\".\n"
                },
                {
                    "name": "Internationalization Functions",
                    "content": "The  following  functions may be used from within your AWK program for translating strings at\nrun-time.  For full details, see GAWK: Effective AWK Programming.\n\nbindtextdomain(directory [, domain])\nSpecify the directory where gawk looks for the .gmo files, in case they  will  not  or\ncannot be placed in the ``standard'' locations (e.g., during testing).  It returns the\ndirectory where domain is ``bound.''\nThe default domain is the value of TEXTDOMAIN.  If directory is the null string  (\"\"),\nthen bindtextdomain() returns the current binding for the given domain.\n\ndcgettext(string [, domain [, category]])\nReturn  the  translation of string in text domain domain for locale category category.\nThe default value for domain is the current value of TEXTDOMAIN.   The  default  value\nfor category is \"LCMESSAGES\".\nIf  you supply a value for category, it must be a string equal to one of the known lo‐\ncale categories described in GAWK: Effective AWK Programming.  You must also supply  a\ntext domain.  Use TEXTDOMAIN if you want to use the current domain.\n\ndcngettext(string1, string2, number [, domain [, category]])\nReturn  the  plural  form used for number of the translation of string1 and string2 in\ntext domain domain for locale category category.  The default value for domain is  the\ncurrent value of TEXTDOMAIN.  The default value for category is \"LCMESSAGES\".\nIf  you supply a value for category, it must be a string equal to one of the known lo‐\ncale categories described in GAWK: Effective AWK Programming.  You must also supply  a\ntext domain.  Use TEXTDOMAIN if you want to use the current domain.\n"
                }
            ]
        },
        "USER-DEFINED FUNCTIONS": {
            "content": "Functions in AWK are defined as follows:\n\nfunction name(parameter list) { statements }\n\nFunctions execute when they are called from within expressions in either patterns or actions.\nActual parameters supplied in the function call are used to instantiate the formal parameters\ndeclared  in  the  function.   Arrays  are passed by reference, other variables are passed by\nvalue.\n\nSince functions were not originally part of the AWK language, the provision for  local  vari‐\nables  is  rather  clumsy:  They are declared as extra parameters in the parameter list.  The\nconvention is to separate local variables from real parameters by extra spaces in the parame‐\nter list.  For example:\n\nfunction  f(p, q,     a, b)   # a and b are local\n{\n...\n}\n\n/abc/     { ... ; f(1, 2) ; ... }\n\nThe  left parenthesis in a function call is required to immediately follow the function name,\nwithout any intervening whitespace.  This avoids a syntactic ambiguity with the concatenation\noperator.  This restriction does not apply to the built-in functions listed above.\n\nFunctions  may call each other and may be recursive.  Function parameters used as local vari‐\nables are initialized to the null string and the number zero upon function invocation.\n\nUse return expr to return a value from a function.  The return value is undefined if no value\nis provided, or if the function returns by “falling off” the end.\n\nAs  a  gawk extension, functions may be called indirectly. To do this, assign the name of the\nfunction to be called, as a string, to a variable.  Then use the variable as if it  were  the\nname of a function, prefixed with an @ sign, like so:\nfunction myfunc()\n{\nprint \"myfunc called\"\n...\n}\n\n{    ...\nthefunc = \"myfunc\"\n@thefunc()    # call through thefunc to myfunc\n...\n}\nAs  of  version 4.1.2, this works with user-defined functions, built-in functions, and exten‐\nsion functions.\n\nIf --lint has been provided, gawk warns about calls to undefined functions at parse time, in‐\nstead of at run time.  Calling an undefined function at run time is a fatal error.\n\nThe word func may be used in place of function, although this is deprecated.\n",
            "subsections": []
        },
        "DYNAMICALLY LOADING NEW FUNCTIONS": {
            "content": "You  can  dynamically  add  new functions written in C or C++ to the running gawk interpreter\nwith the @load statement.  The full details are beyond the scope of  this  manual  page;  see\nGAWK: Effective AWK Programming.\n",
            "subsections": []
        },
        "SIGNALS": {
            "content": "The gawk profiler accepts two signals.  SIGUSR1 causes it to dump a profile and function call\nstack to the profile file, which is either awkprof.out, or whatever file was named  with  the\n--profile  option.   It  then  continues  to run.  SIGHUP causes gawk to dump the profile and\nfunction call stack and then exit.\n",
            "subsections": []
        },
        "INTERNATIONALIZATION": {
            "content": "String constants are sequences of characters  enclosed  in  double  quotes.   In  non-English\nspeaking  environments, it is possible to mark strings in the AWK program as requiring trans‐\nlation to the local natural language. Such strings are marked in the AWK program with a lead‐\ning underscore (“”).  For example,\n\ngawk 'BEGIN { print \"hello, world\" }'\n\nalways prints hello, world.  But,\n\ngawk 'BEGIN { print \"hello, world\" }'\n\nmight print bonjour, monde in France.\n\nThere are several steps involved in producing and running a localizable AWK program.\n\n1.  Add a BEGIN action to assign a value to the TEXTDOMAIN variable to set the text domain to\na name associated with your program:\n\nBEGIN { TEXTDOMAIN = \"myprog\" }\n\nThis allows gawk to find the .gmo file associated with your program.  Without this  step,\ngawk  uses  the messages text domain, which likely does not contain translations for your\nprogram.\n\n2.  Mark all strings that should be translated with leading underscores.\n\n3.  If necessary, use the dcgettext() and/or bindtextdomain() functions in your  program,  as\nappropriate.\n\n4.  Run gawk --gen-pot -f myprog.awk > myprog.pot to generate a .pot file for your program.\n\n5.  Provide appropriate translations, and build and install the corresponding .gmo files.\n\nThe  internationalization  features  are described in full detail in GAWK: Effective AWK Pro‐\ngramming.\n",
            "subsections": []
        },
        "POSIX COMPATIBILITY": {
            "content": "A primary goal for gawk is compatibility with the POSIX standard, as well as with the  latest\nversion  of Brian Kernighan's awk.  To this end, gawk incorporates the following user visible\nfeatures which are not described in the AWK book, but are part of the Brian Kernighan's  ver‐\nsion of awk, and are in the POSIX standard.\n\nThe  book  indicates  that  command line variable assignment happens when awk would otherwise\nopen the argument as a file, which is after the BEGIN rule is executed.  However, in  earlier\nimplementations, when such an assignment appeared before any file names, the assignment would\nhappen before the BEGIN rule was run.  Applications came to depend on this  “feature.”   When\nawk was changed to match its documentation, the -v option for assigning variables before pro‐\ngram execution was added to accommodate applications that depended  upon  the  old  behavior.\n(This  feature  was agreed upon by both the Bell Laboratories developers and the GNU develop‐\ners.)\n\nWhen processing arguments, gawk uses the special option “--” to signal the end of  arguments.\nIn compatibility mode, it warns about but otherwise ignores undefined options.  In normal op‐\neration, such arguments are passed on to the AWK program for it to process.\n\nThe AWK book does not define the return value of srand().  The POSIX standard has  it  return\nthe  seed it was using, to allow keeping track of random number sequences.  Therefore srand()\nin gawk also returns its current seed.\n\nOther features are: The use of multiple -f options (from MKS awk); the ENVIRON array; the \\a,\nand \\v escape sequences (done originally in gawk and fed back into the Bell Laboratories ver‐\nsion); the tolower() and toupper() built-in functions (from the Bell  Laboratories  version);\nand  the  ISO C conversion specifications in printf (done first in the Bell Laboratories ver‐\nsion).\n",
            "subsections": []
        },
        "HISTORICAL FEATURES": {
            "content": "There is one feature of historical AWK implementations that gawk supports: It is possible  to\ncall  the length() built-in function not only with no argument, but even without parentheses!\nThus,\n\na = length     # Holy Algol 60, Batman!\n\nis the same as either of\n\na = length()\na = length($0)\n\nUsing this feature is poor practice, and gawk issues a warning about its  use  if  --lint  is\nspecified on the command line.\n",
            "subsections": []
        },
        "GNU EXTENSIONS": {
            "content": "Gawk  has a too-large number of extensions to POSIX awk.  They are described in this section.\nAll the extensions described here can be disabled by invoking gawk with the --traditional  or\n--posix options.\n\nThe following features of gawk are not available in POSIX awk.\n\n• No path search is performed for files named via the -f option.  Therefore the AWKPATH envi‐\nronment variable is not special.\n\n• There is no facility for doing file inclusion (gawk's @include mechanism).\n\n• There is no facility for dynamically adding new functions written in C (gawk's @load mecha‐\nnism).\n\n• The \\x escape sequence.\n\n• The ability to continue lines after ?  and :.\n\n• Octal and hexadecimal constants in AWK programs.\n\n• The ARGIND, BINMODE, ERRNO, LINT, PREC, ROUNDMODE, RT and TEXTDOMAIN variables are not spe‐\ncial.\n\n• The IGNORECASE variable and its side-effects are not available.\n\n• The FIELDWIDTHS variable and fixed-width field splitting.\n\n• The FPAT variable and field splitting based on field values.\n\n• The FUNCTAB, SYMTAB, and PROCINFO arrays are not available.\n\n• The use of RS as a regular expression.\n\n• The special file names available for I/O redirection are not recognized.\n\n• The |& operator for creating coprocesses.\n\n• The BEGINFILE and ENDFILE special patterns are not available.\n\n• The ability to split out individual characters using the null string as the  value  of  FS,\nand as the third argument to split().\n\n• An optional fourth argument to split() to receive the separator texts.\n\n• The optional second argument to the close() function.\n\n• The optional third argument to the match() function.\n\n• The ability to use positional specifiers with printf and sprintf().\n\n• The ability to pass an array to length().\n\n• The  and(),  asort(),  asorti(), bindtextdomain(), compl(), dcgettext(), dcngettext(), gen‐‐\nsub(), lshift(), mktime(), or(), patsplit(), rshift(),  strftime(),  strtonum(),  systime()\nand xor() functions.\n\n• Localizable strings.\n\n• Non-fatal I/O.\n\n• Retryable I/O.\n\nThe  AWK  book  does not define the return value of the close() function.  Gawk's close() re‐\nturns the value from fclose(3), or pclose(3), when closing an output file  or  pipe,  respec‐\ntively.   It  returns the process's exit status when closing an input pipe.  The return value\nis -1 if the named file, pipe or coprocess was not opened with a redirection.\n\nWhen gawk is invoked with the --traditional option, if the fs argument to the  -F  option  is\n“t”,  then FS is set to the tab character.  Note that typing gawk -F\\t ...  simply causes the\nshell to quote the “t,” and does not pass “\\t” to the -F option.  Since this is a rather ugly\nspecial  case,  it is not the default behavior.  This behavior also does not occur if --posix\nhas been specified.  To really get a tab character as the field separator, it is best to  use\nsingle quotes: gawk -F'\\t' ....\n",
            "subsections": []
        },
        "ENVIRONMENT VARIABLES": {
            "content": "The  AWKPATH  environment  variable  can  be  used to provide a list of directories that gawk\nsearches when looking for files named via the -f, --file, -i and --include options,  and  the\n@include  directive.  If the initial search fails, the path is searched again after appending\n.awk to the filename.\n\nThe AWKLIBPATH environment variable can be used to provide a list of  directories  that  gawk\nsearches when looking for files named via the -l and --load options.\n\nThe  GAWKREADTIMEOUT  environment variable can be used to specify a timeout in milliseconds\nfor reading input from a terminal, pipe or two-way communication including sockets.\n\nFor connection to a remote host via socket, GAWKSOCKRETRIES controls the number of retries,\nand  GAWKMSECSLEEP  the interval between retries.  The interval is in milliseconds. On sys‐\ntems that do not support usleep(3), the value is rounded up to an integral number of seconds.\n\nIf POSIXLYCORRECT exists in the environment, then gawk behaves exactly  as  if  --posix  had\nbeen specified on the command line.  If --lint has been specified, gawk issues a warning mes‐\nsage to this effect.\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "If the exit statement is used with a value, then gawk exits with the numeric value  given  to\nit.\n\nOtherwise,  if  there  were  no problems during execution, gawk exits with the value of the C\nconstant EXITSUCCESS.  This is usually zero.\n\nIf an error occurs, gawk exits with the value of the C constant EXITFAILURE.  This  is  usu‐\nally one.\n\nIf  gawk  exits  because  of a fatal error, the exit status is 2.  On non-POSIX systems, this\nvalue may be mapped to EXITFAILURE.\n",
            "subsections": []
        },
        "VERSION INFORMATION": {
            "content": "This man page documents gawk, version 5.1.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "The original version of UNIX awk was designed and implemented  by  Alfred  Aho,  Peter  Wein‐\nberger,  and Brian Kernighan of Bell Laboratories.  Brian Kernighan continues to maintain and\nenhance it.\n\nPaul Rubin and Jay Fenlason, of the Free Software Foundation, wrote gawk,  to  be  compatible\nwith the original version of awk distributed in Seventh Edition UNIX.  John Woods contributed\na number of bug fixes.  David Trueman, with contributions from Arnold Robbins, made gawk com‐\npatible with the new version of UNIX awk.  Arnold Robbins is the current maintainer.\n\nSee GAWK: Effective AWK Programming for a full list of the contributors to gawk and its docu‐\nmentation.\n\nSee the README file in the gawk distribution for up-to-date information about maintainers and\nwhich ports are currently supported.\n",
            "subsections": []
        },
        "BUG REPORTS": {
            "content": "If  you  find a bug in gawk, please send electronic mail to bug-gawk@gnu.org.  Please include\nyour operating system and its revision, the version of gawk (from gawk  --version),  which  C\ncompiler  you  used  to compile it, and a test program and data that are as small as possible\nfor reproducing the problem.\n\nBefore sending a bug report, please do the following things.  First, verify that you have the\nlatest  version  of  gawk.  Many bugs (usually subtle ones) are fixed at each release, and if\nyours is out of date, the problem may already have been solved.  Second, please see  if  set‐\nting  the  environment  variable LCALL to LCALL=C causes things to behave as you expect. If\nso, it's a locale issue, and may or may not really be a bug.  Finally, please read  this  man\npage  and  the  reference manual carefully to be sure that what you think is a bug really is,\ninstead of just a quirk in the language.\n\nWhatever you do, do NOT post a bug report in comp.lang.awk.  While the gawk developers  occa‐\nsionally  read this newsgroup, posting bug reports there is an unreliable way to report bugs.\nSimilarly, do NOT use a web forum (such as Stack  Overflow)  for  reporting  bugs.   Instead,\nplease use the electronic mail addresses given above.  Really.\n\nIf  you're  using a GNU/Linux or BSD-based system, you may wish to submit a bug report to the\nvendor of your distribution.  That's fine, but please send a copy to the official  email  ad‐\ndress  as  well, since there's no guarantee that the bug report will be forwarded to the gawk\nmaintainer.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "The -F option is not necessary given the command line variable assignment feature; it remains\nonly for backwards compatibility.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "egrep(1),  sed(1), getpid(2), getppid(2), getpgrp(2), getuid(2), geteuid(2), getgid(2), gete‐\ngid(2), getgroups(2), printf(3), strftime(3), usleep(3)\n\nThe AWK Programming Language, Alfred V. Aho, Brian W. Kernighan, Peter J.  Weinberger,  Addi‐\nson-Wesley, 1988.  ISBN 0-201-07981-X.\n\nGAWK: Effective AWK Programming, Edition 5.1, shipped with the gawk source.  The current ver‐\nsion of this document is available online at https://www.gnu.org/software/gawk/manual.\n\nThe GNU gettext documentation, available online at https://www.gnu.org/software/gettext.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Print and sort the login names of all users:\n\nBEGIN     { FS = \":\" }\n{ print $1 | \"sort\" }\n\nCount lines in a file:\n\n{ nlines++ }\nEND  { print nlines }\n\nPrecede each line by its number in the file:\n\n{ print FNR, $0 }\n\nConcatenate and line number (a variation on a theme):\n\n{ print NR, $0 }\n\nRun an external command for particular lines of data:\n\ntail -f accesslog |\nawk '/myhome.html/ { system(\"nmap \" $1 \">> logdir/myhome.html\") }'\n",
            "subsections": []
        },
        "ACKNOWLEDGEMENTS": {
            "content": "Brian Kernighan provided valuable assistance during testing and debugging.  We thank him.\n",
            "subsections": []
        },
        "COPYING PERMISSIONS": {
            "content": "Copyright © 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,  1999,  2001,  2002,  2003,\n2004,  2005,  2007,  2009,  2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020,\nFree Software Foundation, Inc.\n\nPermission is granted to make and distribute verbatim copies of this manual page provided the\ncopyright notice and this permission notice are preserved on all copies.\n\nPermission  is granted to copy and distribute modified versions of this manual page under the\nconditions for verbatim copying, provided that the entire resulting derived work is  distrib‐\nuted under the terms of a permission notice identical to this one.\n\nPermission  is  granted  to copy and distribute translations of this manual page into another\nlanguage, under the above conditions for modified versions, except that this  permission  no‐\ntice may be stated in a translation approved by the Foundation.\n\n\n\nFree Software Foundation                     Mar 23 2020                                     GAWK(1)",
            "subsections": []
        }
    },
    "summary": "gawk - pattern scanning and processing language",
    "flags": [
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "--file program-file Read the AWK program source from the file program-file, instead of from the first com‐ mand line argument. Multiple -f (or --file) options may be used. Files read with -f are treated as if they begin with an implicit @namespace \"awk\" statement."
        },
        {
            "flag": "-F",
            "long": null,
            "arg": null,
            "description": "--field-separator fs Use fs for the input field separator (the value of the FS predefined variable)."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "--assign var=val Assign the value val to the variable var, before execution of the program begins. Such variable values are available to the BEGIN rule of an AWK program."
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--characters-as-bytes",
            "arg": null,
            "description": "Treat all input data as single-byte characters. In other words, don't pay any atten‐ tion to the locale information when attempting to process strings as multibyte charac‐ ters. The --posix option overrides this one."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--traditional",
            "arg": null,
            "description": "Run in compatibility mode. In compatibility mode, gawk behaves identically to Brian Kernighan's awk; none of the GNU-specific extensions are recognized. See GNU EXTEN‐‐ SIONS, below, for more information."
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--copyright",
            "arg": null,
            "description": "Print the short version of the GNU copyright information message on the standard out‐ put and exit successfully."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "--dump-variables[=file] Print a sorted list of global variables, their types and final values to file. If no file is provided, gawk uses a file named awkvars.out in the current directory. Having a list of all the global variables is a good way to look for typographical er‐ rors in your programs. You would also use this option if you have a large program with a lot of functions, and you want to be sure that your functions don't inadver‐ tently use global variables that you meant to be local. (This is a particularly easy mistake to make with simple variable names like i, j, and so on.)"
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": "--debug[=file] Enable debugging of AWK programs. By default, the debugger reads commands interac‐ tively from the keyboard (standard input). The optional file argument specifies a file with a list of commands for the debugger to execute non-interactively."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "--source program-text Use program-text as AWK program source code. This option allows the easy intermixing of library functions (used via the -f and --include options) with source code entered on the command line. It is intended primarily for medium to large AWK programs used in shell scripts. Each argument supplied via -e is treated as if it begins with an implicit @namespace \"awk\" statement."
        },
        {
            "flag": "-E",
            "long": null,
            "arg": null,
            "description": "--exec file Similar to -f, however, this is option is the last one processed. This should be used with #! scripts, particularly for CGI applications, to avoid passing in options or source code (!) on the command line from a URL. This option disables command-line variable assignments."
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--gen-pot",
            "arg": null,
            "description": "Scan and parse the AWK program, and generate a GNU .pot (Portable Object Template) format file on standard output with entries for all localizable strings in the pro‐ gram. The program itself is not executed. See the GNU gettext distribution for more information on .pot files."
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "--help Print a relatively short summary of the available options on the standard output. (Per the GNU Coding Standards, these options cause an immediate, successful exit.)"
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "--include include-file Load an awk source library. This searches for the library using the AWKPATH environ‐ ment variable. If the initial search fails, another attempt will be made after ap‐ pending the .awk suffix. The file will be loaded only once (i.e., duplicates are eliminated), and the code does not constitute the main program source. Files read with --include are treated as if they begin with an implicit @namespace \"awk\" state‐ ment."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "--load lib Load a gawk extension from the shared library lib. This searches for the library us‐ ing the AWKLIBPATH environment variable. If the initial search fails, another attempt will be made after appending the default shared library suffix for the platform. The library initialization routine is expected to be named dlload()."
        },
        {
            "flag": "-L",
            "long": null,
            "arg": null,
            "description": "--lint[=value] Provide warnings about constructs that are dubious or non-portable to other AWK imple‐ mentations. With an optional argument of fatal, lint warnings become fatal errors. This may be drastic, but its use will certainly encourage the development of cleaner AWK programs. With an optional argument of invalid, only warnings about things that are actually invalid are issued. (This is not fully implemented yet.) With an op‐ tional argument of no-ext, warnings about gawk extensions are disabled."
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--bignum",
            "arg": null,
            "description": "Force arbitrary precision arithmetic on numbers. This option has no effect if gawk is not compiled to use the GNU MPFR and GMP libraries. (In such a case, gawk issues a warning.)"
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--non-decimal-data",
            "arg": null,
            "description": "Recognize octal and hexadecimal values in input data. Use this option with great cau‐ tion!"
        },
        {
            "flag": "-N",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--use-lc-numeric",
            "arg": null,
            "description": "Force gawk to use the locale's decimal point character when parsing input data. Al‐ though the POSIX standard requires this behavior, and gawk does so when --posix is in effect, the default is to follow traditional behavior and use a period as the decimal point, even in locales where the period is not the decimal point character. This op‐ tion overrides the default behavior, without the full draconian strictness of the --posix option."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "--pretty-print[=file] Output a pretty printed version of the program to file. If no file is provided, gawk uses a file named awkprof.out in the current directory. This option implies --no-op‐‐ timize."
        },
        {
            "flag": "-O",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--optimize",
            "arg": null,
            "description": "Enable gawk's default optimizations upon the internal representation of the program. Currently, this just includes simple constant folding. This option is on by default."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "--profile[=prof-file] Start a profiling session, and send the profiling data to prof-file. The default is awkprof.out. The profile contains execution counts of each statement in the program in the left margin and function call counts for each user-defined function. This op‐ tion implies --no-optimize."
        },
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--posix",
            "arg": null,
            "description": "This turns on compatibility mode, with the following additional restrictions: • \\x escape sequences are not recognized. • You cannot continue lines after ? and :. • The synonym func for the keyword function is not recognized. • The operators and = cannot be used in place of ^ and ^=."
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--re-interval",
            "arg": null,
            "description": "Enable the use of interval expressions in regular expression matching (see Regular Ex‐‐ pressions, below). Interval expressions were not traditionally available in the AWK language. The POSIX standard added them, to make awk and egrep consistent with each other. They are enabled by default, but this option remains for use together with --traditional."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--no-optimize",
            "arg": null,
            "description": "Disable gawk's default optimizations upon the internal representation of the program."
        },
        {
            "flag": "-S",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--sandbox",
            "arg": null,
            "description": "Run gawk in sandbox mode, disabling the system() function, input redirection with get‐‐ line, output redirection with print and printf, and loading dynamic extensions. Com‐ mand execution (through pipelines) is also disabled. This effectively blocks a script from accessing local resources, except for the files specified on the command line."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--lint-old",
            "arg": null,
            "description": "Provide warnings about constructs that are not portable to the original version of UNIX awk."
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Print version information for this particular copy of gawk on the standard output. This is useful mainly for knowing if the current copy of gawk on your system is up to date with respect to whatever the Free Software Foundation is distributing. This is also useful when reporting bugs. (Per the GNU Coding Standards, these options cause an immediate, successful exit.) -- Signal the end of options. This is useful to allow further arguments to the AWK pro‐ gram itself to start with a “-”. This provides consistency with the argument parsing convention used by most other POSIX programs. In compatibility mode, any other options are flagged as invalid, but are otherwise ignored. In normal operation, as long as program text has been supplied, unknown options are passed on to the AWK program in the ARGV array for processing. This is particularly useful for running AWK programs via the #! executable interpreter mechanism. For POSIX compatibility, the -W option may be used, followed by the name of a long option."
        }
    ],
    "examples": [
        "Print and sort the login names of all users:",
        "BEGIN     { FS = \":\" }",
        "{ print $1 | \"sort\" }",
        "Count lines in a file:",
        "{ nlines++ }",
        "END  { print nlines }",
        "Precede each line by its number in the file:",
        "{ print FNR, $0 }",
        "Concatenate and line number (a variation on a theme):",
        "{ print NR, $0 }",
        "Run an external command for particular lines of data:",
        "tail -f accesslog |",
        "awk '/myhome.html/ { system(\"nmap \" $1 \">> logdir/myhome.html\") }'"
    ],
    "see_also": [
        {
            "name": "egrep",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/egrep/1/json"
        },
        {
            "name": "sed",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/sed/1/json"
        },
        {
            "name": "getpid",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/getpid/2/json"
        },
        {
            "name": "getppid",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/getppid/2/json"
        },
        {
            "name": "getpgrp",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/getpgrp/2/json"
        },
        {
            "name": "getuid",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/getuid/2/json"
        },
        {
            "name": "geteuid",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/geteuid/2/json"
        },
        {
            "name": "getgid",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/getgid/2/json"
        },
        {
            "name": "gid",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/gid/2/json"
        },
        {
            "name": "getgroups",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/getgroups/2/json"
        },
        {
            "name": "printf",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/printf/3/json"
        },
        {
            "name": "strftime",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/strftime/3/json"
        },
        {
            "name": "usleep",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/usleep/3/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "A versatile programming language for working on files.",
        "examples": [
            {
                "description": "Print the fifth column (a.k.a. field) in a space-separated file",
                "command": "awk '{print $5}' {{path/to/file}}"
            },
            {
                "description": "Print the second column of the lines containing \"foo\" in a space-separated file",
                "command": "awk '/{{foo}}/ {print $2}' {{path/to/file}}"
            },
            {
                "description": "Print the last column of each line in a file, using a comma (instead of space) as a field separator",
                "command": "awk -F ',' '{print $NF}' {{path/to/file}}"
            },
            {
                "description": "Sum the values in the first column of a file and print the total",
                "command": "awk '{s+=$1} END {print s}' {{path/to/file}}"
            },
            {
                "description": "Print every third line starting from the first line",
                "command": "awk 'NR%3==1' {{path/to/file}}"
            },
            {
                "description": "Print different values based on conditions",
                "command": "awk '{if ($1 == \"foo\") print \"Exact match foo\"; else if ($1 ~ \"bar\") print \"Partial match bar\"; else print \"Baz\"}' {{path/to/file}}"
            },
            {
                "description": "Print all the lines which the 10th column value is between a min and a max",
                "command": "awk '($10 >= {{min_value}} && $10 <= {{max_value}})' {{path/to/file}}"
            },
            {
                "description": "Print table of users with UID >=1000 with header and formatted output, using colon as separator (`%-20s` mean: 20 left-align string characters, `%6s` means: 6 right-align string characters)",
                "command": "awk 'BEGIN {FS=\":\";printf \"%-20s %6s %25s\\n\", \"Name\", \"UID\", \"Shell\"} $4 >= 1000 {printf \"%-20s %6d %25s\\n\", $1, $4, $7}' /etc/passwd"
            }
        ]
    }
}