home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / doc / gawk.man < prev    next >
Text File  |  1993-06-13  |  50KB  |  1,387 lines

  1.  
  2.  
  3.  
  4. GAWK(1)                  Utility Commands                 GAWK(1)
  5.  
  6.  
  7. NAME
  8.        gawk - pattern scanning and processing language
  9.  
  10. SYNOPSIS
  11.        gawk [ POSIX or GNU style options ] -f program-file [ -- ]
  12.        file ...
  13.        gawk [ POSIX or GNU style options ] [  --  ]  program-text
  14.        file ...
  15.  
  16. DESCRIPTION
  17.        Gawk  is  the GNU Project's implementation of the AWK pro-
  18.        gramming language.  It conforms to the definition  of  the
  19.        language  in  the POSIX 1003.2 Command Language And Utili-
  20.        ties Standard.  This version  in  turn  is  based  on  the
  21.        description  in  The  AWK  Programming  Language,  by Aho,
  22.        Kernighan, and Weinberger, with  the  additional  features
  23.        defined  in  the  System  V Release 4 version of UNIX awk.
  24.        Gawk also provides some GNU-specific extensions.
  25.  
  26.        The command line consists of options to gawk  itself,  the
  27.        AWK  program  text  (if  not supplied via the -f or --file
  28.        options), and values to be made available in the ARGC  and
  29.        ARGV pre-defined AWK variables.
  30.  
  31. OPTIONS
  32.        Gawk  options may be either the traditional POSIX one let-
  33.        ter options, or the GNU style long options.   POSIX  style
  34.        options  start with a single ``-'', while GNU long options
  35.        start with ``--''.  GNU style long  options  are  provided
  36.        for both GNU-specific features and for POSIX mandated fea-
  37.        tures.  Other implementations  of  the  AWK  language  are
  38.        likely  to only accept the traditional one letter options.
  39.  
  40.        Following the POSIX standard,  gawk-specific  options  are
  41.        supplied  via  arguments  to  the  -W option.  Multiple -W
  42.        options may be supplied, or multiple arguments may be sup-
  43.        plied  together  if  they  are  separated  by  commas,  or
  44.        enclosed in quotes and separated by white space.  Case  is
  45.        ignored in arguments to the -W option.  Each -W option has
  46.        a corresponding GNU style long option, as detailed  below.
  47.  
  48.        Gawk accepts the following options.
  49.  
  50.        -F fs
  51.        --field-separator=fs
  52.               Use  fs for the input field separator (the value of
  53.               the FS predefined variable).
  54.  
  55.        -v var=val
  56.        --assign=var=val
  57.               Assign the value val, to the variable  var,  before
  58.               execution  of  the  program  begins.  Such variable
  59.               values are available to the BEGIN block of  an  AWK
  60.               program.
  61.  
  62.  
  63.  
  64. Free Software Foundation   Apr 15 1993                          1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GAWK(1)                  Utility Commands                 GAWK(1)
  71.  
  72.  
  73.        -f program-file
  74.        --file=program-file
  75.               Read  the AWK program source from the file program-
  76.               file, instead of from the first command line  argu-
  77.               ment.  Multiple -f (or --file) options may be used.
  78.  
  79.        -W compat
  80.        --compat    Run in compatibility mode.   In  compatibility
  81.                    mode,  gawk  behaves  identically to UNIX awk;
  82.                    none of the GNU-specific extensions are recog-
  83.                    nized.   See  GNU  EXTENSIONS, below, for more
  84.                    information.
  85.  
  86.        -W copyleft
  87.        -W copyright
  88.        --copyleft
  89.        --copyright Print the short version of the  GNU  copyright
  90.                    information message on the error output.
  91.  
  92.        -W help
  93.        -W usage
  94.        --help
  95.        --usage     Print a relatively short summary of the avail-
  96.                    able options on the error output.
  97.  
  98.        -W lint
  99.        --lint      Provide warnings  about  constructs  that  are
  100.                    dubious or non-portable to other AWK implemen-
  101.                    tations.
  102.        -W posix
  103.        --posix     This turns on  compatibility  mode,  with  the
  104.                    following additional restrictions:
  105.  
  106.                    o \x escape sequences are not recognized.
  107.  
  108.                    o The synonym func for the keyword function is
  109.                      not recognized.
  110.  
  111.                    o The operators ** and **= cannot be  used  in
  112.                      place of ^ and ^=.
  113.  
  114.        -W source=program-text
  115.        --source=program-text
  116.                    Use  program-text  as AWK program source code.
  117.                    This option allows  the  easy  intermixing  of
  118.                    library  functions (used via the -f and --file
  119.                    options) with source code entered on the  com-
  120.                    mand  line.   It  is  intended  primarily  for
  121.                    medium to large  size  AWK  programs  used  in
  122.                    shell scripts.
  123.                    The  -W  source=  form of this option uses the
  124.                    rest of the command line argument for program-
  125.                    text;  no  other  options to -W will be recog-
  126.                    nized in the same argument.
  127.  
  128.  
  129.  
  130. Free Software Foundation   Apr 15 1993                          2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. GAWK(1)                  Utility Commands                 GAWK(1)
  137.  
  138.  
  139.        -W version
  140.        --version   Print version information for this  particular
  141.                    copy  of  gawk  on  the error output.  This is
  142.                    useful mainly for knowing if the current  copy
  143.                    of  gawk  on  your  system  is up to date with
  144.                    respect to whatever the Free Software  Founda-
  145.                    tion is distributing.
  146.  
  147.        --          Signal  the  end of options. This is useful to
  148.                    allow further arguments  to  the  AWK  program
  149.                    itself  to start with a ``-''.  This is mainly
  150.                    for consistency with the argument parsing con-
  151.                    vention used by most other POSIX programs.
  152.  
  153.        Any  other  options are flagged as illegal, but are other-
  154.        wise ignored.
  155.  
  156. AWK PROGRAM EXECUTION
  157.        An AWK program consists of a  sequence  of  pattern-action
  158.        statements and optional function definitions.
  159.  
  160.               pattern   { action statements }
  161.               function name(parameter list) { statements }
  162.  
  163.        Gawk  first  reads  the  program  source from the program-
  164.        file(s) if specified, or from the first  non-option  argu-
  165.        ment  on the command line.  The -f option may be used mul-
  166.        tiple times on the command line.  Gawk will read the  pro-
  167.        gram  text  as  if all the program-files had been concate-
  168.        nated together.  This is useful for building libraries  of
  169.        AWK  functions, without having to include them in each new
  170.        AWK program that uses them.  To use a library function  in
  171.        a  file from a program typed in on the command line, spec-
  172.        ify /dev/tty as one of the program-files, type  your  pro-
  173.        gram, and end it with a ^D (control-d).
  174.  
  175.        The  environment  variable AWKPATH specifies a search path
  176.        to use when finding source files named with the -f option.
  177.        If  this  variable  does  not  exist,  the default path is
  178.        ".:/usr/lib/awk:/usr/local/lib/awk".  If a file name given
  179.        to  the  -f  option  contains  a  ``/'' character, no path
  180.        search is performed.
  181.  
  182.        Gawk executes AWK programs in the following order.  First,
  183.        gawk  compiles  the  program into an internal form.  Next,
  184.        all variable assignments specified via the -v  option  are
  185.        performed.   Then,  gawk  executes  the  code in the BEGIN
  186.        block(s) (if any), and then proceeds  to  read  each  file
  187.        named  in  the ARGV array.  If there are no files named on
  188.        the command line, gawk reads the standard input.
  189.  
  190.        If a filename on the command line has the form var=val  it
  191.        is treated as a variable assignment. The variable var will
  192.        be assigned the value val.  (This happens after any  BEGIN
  193.  
  194.  
  195.  
  196. Free Software Foundation   Apr 15 1993                          3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. GAWK(1)                  Utility Commands                 GAWK(1)
  203.  
  204.  
  205.        block(s) have been run.)  Command line variable assignment
  206.        is most useful for dynamically  assigning  values  to  the
  207.        variables  AWK  uses  to  control how input is broken into
  208.        fields and records. It  is  also  useful  for  controlling
  209.        state  if  multiple  passes  are needed over a single data
  210.        file.
  211.  
  212.        If the value of a particular  element  of  ARGV  is  empty
  213.        (""), gawk skips over it.
  214.  
  215.        For  each  line  in  the  input,  gawk  tests to see if it
  216.        matches any pattern in the AWK program.  For each  pattern
  217.        that  the line matches, the associated action is executed.
  218.        The patterns are tested in the order  they  occur  in  the
  219.        program.
  220.  
  221.        Finally,  after  all the input is exhausted, gawk executes
  222.        the code in the END block(s) (if any).
  223.  
  224. VARIABLES AND FIELDS
  225.        AWK variables are dynamic; they come into  existence  when
  226.        they  are  first  used.  Their values are either floating-
  227.        point numbers or strings, or both, depending upon how they
  228.        are  used.  AWK  also  has  one dimension arrays; multiply
  229.        dimensioned arrays may be simulated.  Several  pre-defined
  230.        variables  are  set  as  a  program  runs;  these  will be
  231.        described as needed and summarized below.
  232.  
  233.    Fields
  234.        As each input line is read,  gawk  splits  the  line  into
  235.        fields,  using  the  value of the FS variable as the field
  236.        separator.  If FS is a single character, fields are  sepa-
  237.        rated  by that character.  Otherwise, FS is expected to be
  238.        a full regular expression.  In the special case that FS is
  239.        a  single  blank,  fields  are separated by runs of blanks
  240.        and/or tabs.  Note  that  the  value  of  IGNORECASE  (see
  241.        below)  will also affect how fields are split when FS is a
  242.        regular expression.
  243.  
  244.        If the FIELDWIDTHS variable is set to  a  space  separated
  245.        list  of  numbers,  each  field  is expected to have fixed
  246.        width, and gawk will split up the record using the  speci-
  247.        fied widths.  The value of FS is ignored.  Assigning a new
  248.        value to FS overrides the use of FIELDWIDTHS, and restores
  249.        the default behavior.
  250.  
  251.        Each  field  in  the  input  line may be referenced by its
  252.        position, $1, $2, and so on.  $0 is the  whole  line.  The
  253.        value  of a field may be assigned to as well.  Fields need
  254.        not be referenced by constants:
  255.  
  256.               n = 5
  257.               print $n
  258.  
  259.  
  260.  
  261.  
  262. Free Software Foundation   Apr 15 1993                          4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. GAWK(1)                  Utility Commands                 GAWK(1)
  269.  
  270.  
  271.        prints the fifth field in the input line.  The variable NF
  272.        is set to the total number of fields in the input line.
  273.  
  274.        References  to non-existent fields (i.e. fields after $NF)
  275.        produce the null-string.  However,  assigning  to  a  non-
  276.        existent field (e.g., $(NF+2) = 5) will increase the value
  277.        of NF, create any intervening fields with the null  string
  278.        as  their  value,  and  cause the value of $0 to be recom-
  279.        puted, with the fields being separated  by  the  value  of
  280.        OFS.
  281.  
  282.    Built-in Variables
  283.        AWK's built-in variables are:
  284.  
  285.  
  286.        ARGC        The number of command line arguments (does not
  287.                    include  options  to  gawk,  or  the   program
  288.                    source).
  289.  
  290.        ARGIND      The  index  in  ARGV of the current file being
  291.                    processed.
  292.  
  293.        ARGV        Array of command line arguments. The array  is
  294.                    indexed  from  0  to  ARGC  -  1.  Dynamically
  295.                    changing the contents of ARGV can control  the
  296.                    files used for data.
  297.  
  298.        CONVFMT     The  conversion format for numbers, "%.6g", by
  299.                    default.
  300.  
  301.        ENVIRON     An array containing the values of the  current
  302.                    environment.   The  array  is  indexed  by the
  303.                    environment variables, each element being  the
  304.                    value  of that variable (e.g., ENVIRON["HOME"]
  305.                    might be /u/arnold).  Changing this array does
  306.                    not  affect  the  environment seen by programs
  307.                    which gawk spawns via redirection or the  sys-
  308.                    tem()  function.  (This may change in a future
  309.                    version of gawk.)
  310.  
  311.        ERRNO       If a system error occurs either doing a  redi-
  312.                    rection  for  getline,  during a read for get-
  313.                    line, or during a close, then ERRNO will  con-
  314.                    tain a string describing the error.
  315.  
  316.        FIELDWIDTHS A  white-space  separated list of fieldwidths.
  317.                    When set, gawk parses the input into fields of
  318.                    fixed width, instead of using the value of the
  319.                    FS variable as the field separator.  The fixed
  320.                    field  width  facility  is still experimental;
  321.                    expect the semantics to change as gawk evolves
  322.                    over time.
  323.  
  324.        FILENAME    The  name  of  the  current input file.  If no
  325.  
  326.  
  327.  
  328. Free Software Foundation   Apr 15 1993                          5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. GAWK(1)                  Utility Commands                 GAWK(1)
  335.  
  336.  
  337.                    files are specified on the command  line,  the
  338.                    value of FILENAME is ``-''.
  339.  
  340.        FNR         The  input  record number in the current input
  341.                    file.
  342.  
  343.        FS          The input field separator, a blank by default.
  344.  
  345.        IGNORECASE  Controls  the  case-sensitivity of all regular
  346.                    expression operations.  If  IGNORECASE  has  a
  347.                    non-zero   value,  then  pattern  matching  in
  348.                    rules,  field  splitting  with   FS,   regular
  349.                    expression  matching  with  ~  and !~, and the
  350.                    gsub(), index(), match(), split(),  and  sub()
  351.                    pre-defined  functions  will  all  ignore case
  352.                    when  doing  regular  expression   operations.
  353.                    Thus, if IGNORECASE is not equal to zero, /aB/
  354.                    matches all of the strings "ab",  "aB",  "Ab",
  355.                    and "AB".  As with all AWK variables, the ini-
  356.                    tial value of IGNORECASE is zero, so all regu-
  357.                    lar  expression  operations are normally case-
  358.                    sensitive.
  359.  
  360.        NF          The number of  fields  in  the  current  input
  361.                    record.
  362.  
  363.        NR          The total number of input records seen so far.
  364.  
  365.        OFMT        The output  format  for  numbers,  "%.6g",  by
  366.                    default.
  367.  
  368.        OFS         The   output   field  separator,  a  blank  by
  369.                    default.
  370.  
  371.        ORS         The output record separator, by default a new-
  372.                    line.
  373.  
  374.        RS          The  input record separator, by default a new-
  375.                    line.  RS is  exceptional  in  that  only  the
  376.                    first  character  of  its string value is used
  377.                    for separating records.  (This  will  probably
  378.                    change in a future release of gawk.)  If RS is
  379.                    set to the null string, then records are sepa-
  380.                    rated  by  blank lines.  When RS is set to the
  381.                    null string, then the newline character always
  382.                    acts  as  a  field  separator,  in addition to
  383.                    whatever value FS may have.
  384.  
  385.        RSTART      The index of the first  character  matched  by
  386.                    match(); 0 if no match.
  387.  
  388.        RLENGTH     The  length  of the string matched by match();
  389.                    -1 if no match.
  390.  
  391.  
  392.  
  393.  
  394. Free Software Foundation   Apr 15 1993                          6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. GAWK(1)                  Utility Commands                 GAWK(1)
  401.  
  402.  
  403.        SUBSEP      The character used to separate  multiple  sub-
  404.                    scripts  in array elements, by default "\034".
  405.  
  406.    Arrays
  407.        Arrays are subscripted with an expression  between  square
  408.        brackets  ([  and  ]).  If the expression is an expression
  409.        list (expr, expr ...)   then  the  array  subscript  is  a
  410.        string  consisting  of  the  concatenation of the (string)
  411.        value of each expression, separated by the  value  of  the
  412.        SUBSEP variable.  This facility is used to simulate multi-
  413.        ply dimensioned arrays. For example:
  414.  
  415.               i = "A" ; j = "B" ; k = "C"
  416.               x[i, j, k] = "hello, world\n"
  417.  
  418.        assigns the string "hello, world\n" to the element of  the
  419.        array  x which is indexed by the string "A\034B\034C". All
  420.        arrays in AWK are associative, i.e. indexed by string val-
  421.        ues.
  422.  
  423.        The  special  operator  in  may  be used in an if or while
  424.        statement to see if an array has an index consisting of  a
  425.        particular value.
  426.  
  427.               if (val in array)
  428.                    print array[val]
  429.  
  430.        If the array has multiple subscripts, use (i, j) in array.
  431.  
  432.        The in construct may also be used in a for loop to iterate
  433.        over all the elements of an array.
  434.  
  435.        An  element  may be deleted from an array using the delete
  436.        statement.
  437.  
  438.    Variable Typing And Conversion
  439.        Variables and fields may be (floating point)  numbers,  or
  440.        strings,  or  both.  How the value of a variable is inter-
  441.        preted depends upon its context.  If  used  in  a  numeric
  442.        expression,  it  will be treated as a number, if used as a
  443.        string it will be treated as a string.
  444.  
  445.        To force a variable to be treated as a number,  add  0  to
  446.        it;  to force it to be treated as a string, concatenate it
  447.        with the null string.
  448.  
  449.        When a string must be converted to a number,  the  conver-
  450.        sion is accomplished using atof(3).  A number is converted
  451.        to a string by using the value  of  CONVFMT  as  a  format
  452.        string for sprintf(3), with the numeric value of the vari-
  453.        able as the argument.  However, even though all numbers in
  454.        AWK  are  floating-point,  integral values are always con-
  455.        verted as integers.  Thus, given
  456.  
  457.  
  458.  
  459.  
  460. Free Software Foundation   Apr 15 1993                          7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. GAWK(1)                  Utility Commands                 GAWK(1)
  467.  
  468.  
  469.               CONVFMT = "%2.2f"
  470.               a = 12
  471.               b = a ""
  472.  
  473.        the variable b has a value of "12" and not "12.00".
  474.  
  475.        Gawk performs comparisons as follows: If two variables are
  476.        numeric,  they  are compared numerically.  If one value is
  477.        numeric and the  other  has  a  string  value  that  is  a
  478.        ``numeric string,'' then comparisons are also done numeri-
  479.        cally.  Otherwise, the numeric value  is  converted  to  a
  480.        string  and a string comparison is performed.  Two strings
  481.        are compared, of course, as  strings.   According  to  the
  482.        POSIX standard, even if two strings are numeric strings, a
  483.        numeric comparison is performed.  However, this is clearly
  484.        incorrect, and gawk does not do this.
  485.  
  486.        Uninitialized  variables  have the numeric value 0 and the
  487.        string value "" (the null, or empty, string).
  488.  
  489. PATTERNS AND ACTIONS
  490.        AWK is a line oriented language. The pattern comes  first,
  491.        and  then  the action. Action statements are enclosed in {
  492.        and }.  Either the pattern may be missing, or  the  action
  493.        may  be  missing, but, of course, not both. If the pattern
  494.        is missing, the action will be executed for  every  single
  495.        line of input.  A missing action is equivalent to
  496.  
  497.               { print }
  498.  
  499.        which prints the entire line.
  500.  
  501.        Comments  begin  with  the  ``#''  character, and continue
  502.        until the end of the line.  Blank lines  may  be  used  to
  503.        separate  statements.   Normally,  a statement ends with a
  504.        newline, however, this is not the case for lines ending in
  505.        a  ``,'',  ``{'',  ``?'', ``:'', ``&&'', or ``||''.  Lines
  506.        ending in do or else also have their statements  automati-
  507.        cally  continued on the following line.  In other cases, a
  508.        line can be continued by ending it with a ``\'', in  which
  509.        case the newline will be ignored.
  510.  
  511.        Multiple  statements  may be put on one line by separating
  512.        them with a ``;''.  This applies to  both  the  statements
  513.        within the action part of a pattern-action pair (the usual
  514.        case), and to the pattern-action statements themselves.
  515.  
  516.    Patterns
  517.        AWK patterns may be one of the following:
  518.  
  519.               BEGIN
  520.               END
  521.               /regular expression/
  522.               relational expression
  523.  
  524.  
  525.  
  526. Free Software Foundation   Apr 15 1993                          8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. GAWK(1)                  Utility Commands                 GAWK(1)
  533.  
  534.  
  535.               pattern && pattern
  536.               pattern || pattern
  537.               pattern ? pattern : pattern
  538.               (pattern)
  539.               ! pattern
  540.               pattern1, pattern2
  541.  
  542.        BEGIN and END are two special kinds of patterns which  are
  543.        not  tested  against  the  input.  The action parts of all
  544.        BEGIN patterns are merged as if  all  the  statements  had
  545.        been  written  in  a single BEGIN block. They are executed
  546.        before any of the input is read. Similarly,  all  the  END
  547.        blocks  are  merged,  and  executed  when all the input is
  548.        exhausted (or when an exit statement is executed).   BEGIN
  549.        and END patterns cannot be combined with other patterns in
  550.        pattern expressions.  BEGIN and END patterns  cannot  have
  551.        missing action parts.
  552.  
  553.        For  /regular  expression/ patterns, the associated state-
  554.        ment is executed for each input line that matches the reg-
  555.        ular  expression.   Regular  expressions  are  the same as
  556.        those in egrep(1), and are summarized below.
  557.  
  558.        A relational expression  may  use  any  of  the  operators
  559.        defined  below in the section on actions.  These generally
  560.        test whether certain fields match certain regular  expres-
  561.        sions.
  562.  
  563.        The  &&, ||, and !  operators are logical AND, logical OR,
  564.        and logical NOT, respectively, as in C.   They  do  short-
  565.        circuit evaluation, also as in C, and are used for combin-
  566.        ing more primitive pattern expressions. As  in  most  lan-
  567.        guages,  parentheses  may  be  used to change the order of
  568.        evaluation.
  569.  
  570.        The ?: operator is like the same operator  in  C.  If  the
  571.        first pattern is true then the pattern used for testing is
  572.        the second pattern, otherwise it is the third. Only one of
  573.        the second and third patterns is evaluated.
  574.  
  575.        The  pattern1,  pattern2 form of an expression is called a
  576.        range pattern.  It matches all input records starting with
  577.        a  line  that  matches  pattern1,  and  continuing until a
  578.        record that matches pattern2, inclusive. It does not  com-
  579.        bine with any other sort of pattern expression.
  580.  
  581.    Regular Expressions
  582.        Regular  expressions are the extended kind found in egrep.
  583.        They are composed of characters as follows:
  584.  
  585.        c          matches the non-metacharacter c.
  586.  
  587.        \c         matches the literal character c.
  588.  
  589.  
  590.  
  591.  
  592. Free Software Foundation   Apr 15 1993                          9
  593.  
  594.  
  595.  
  596.  
  597.  
  598. GAWK(1)                  Utility Commands                 GAWK(1)
  599.  
  600.  
  601.        .          matches any character except newline.
  602.  
  603.        ^          matches the beginning of a line or a string.
  604.  
  605.        $          matches the end of a line or a string.
  606.  
  607.        [abc...]   character class, matches any of the  characters
  608.                   abc....
  609.  
  610.        [^abc...]  negated  character class, matches any character
  611.                   except abc...  and newline.
  612.  
  613.        r1|r2      alternation: matches either r1 or r2.
  614.  
  615.        r1r2       concatenation: matches r1, and then r2.
  616.  
  617.        r+         matches one or more r's.
  618.  
  619.        r*         matches zero or more r's.
  620.  
  621.        r?         matches zero or one r's.
  622.  
  623.        (r)        grouping: matches r.
  624.  
  625.        The escape sequences that are valid  in  string  constants
  626.        (see below) are also legal in regular expressions.
  627.  
  628.    Actions
  629.        Action statements are enclosed in braces, { and }.  Action
  630.        statements consist of the usual  assignment,  conditional,
  631.        and looping statements found in most languages. The opera-
  632.        tors,  control  statements,  and  input/output  statements
  633.        available are patterned after those in C.
  634.  
  635.    Operators
  636.        The  operators  in AWK, in order of increasing precedence,
  637.        are
  638.  
  639.  
  640.        = += -=
  641.        *= /= %= ^= Assignment. Both absolute  assignment  (var  =
  642.                    value)   and  operator-assignment  (the  other
  643.                    forms) are supported.
  644.  
  645.        ?:          The C conditional  expression.  This  has  the
  646.                    form  expr1 ? expr2 : expr3. If expr1 is true,
  647.                    the value of the expression is  expr2,  other-
  648.                    wise it is expr3.  Only one of expr2 and expr3
  649.                    is evaluated.
  650.  
  651.        ||          Logical OR.
  652.  
  653.        &&          Logical AND.
  654.  
  655.  
  656.  
  657.  
  658. Free Software Foundation   Apr 15 1993                         10
  659.  
  660.  
  661.  
  662.  
  663.  
  664. GAWK(1)                  Utility Commands                 GAWK(1)
  665.  
  666.  
  667.        ~ !~        Regular  expression  match,   negated   match.
  668.                    NOTE: Do not use a constant regular expression
  669.                    (/foo/) on the left-hand side of a  ~  or  !~.
  670.                    Only  use  one  on  the  right-hand side.  The
  671.                    expression /foo/ ~ exp has the same meaning as
  672.                    (($0  ~  /foo/)  ~  exp).  This is usually not
  673.                    what was intended.
  674.  
  675.        < >
  676.        <= >=
  677.        != ==       The regular relational operators.
  678.  
  679.        blank       String concatenation.
  680.  
  681.        + -         Addition and subtraction.
  682.  
  683.        * / %       Multiplication, division, and modulus.
  684.  
  685.        + - !       Unary plus, unary minus, and logical negation.
  686.  
  687.        ^           Exponentiation  (**  may also be used, and **=
  688.                    for the assignment operator).
  689.  
  690.        ++ --       Increment and decrement, both prefix and post-
  691.                    fix.
  692.  
  693.        $           Field reference.
  694.  
  695.    Control Statements
  696.        The control statements are as follows:
  697.  
  698.               if (condition) statement [ else statement ]
  699.               while (condition) statement
  700.               do statement while (condition)
  701.               for (expr1; expr2; expr3) statement
  702.               for (var in array) statement
  703.               break
  704.               continue
  705.               delete array[index]
  706.               exit [ expression ]
  707.               { statements }
  708.  
  709.    I/O Statements
  710.        The input/output statements are as follows:
  711.  
  712.  
  713.        close(filename)       Close file (or pipe, see below).
  714.  
  715.        getline               Set  $0  from next input record; set
  716.                              NF, NR, FNR.
  717.  
  718.        getline <file         Set $0 from next record of file; set
  719.                              NF.
  720.  
  721.  
  722.  
  723.  
  724. Free Software Foundation   Apr 15 1993                         11
  725.  
  726.  
  727.  
  728.  
  729.  
  730. GAWK(1)                  Utility Commands                 GAWK(1)
  731.  
  732.  
  733.        getline var           Set  var from next input record; set
  734.                              NF, FNR.
  735.  
  736.        getline var <file     Set var from next record of file.
  737.  
  738.        next                  Stop processing  the  current  input
  739.                              record.  The  next  input  record is
  740.                              read and processing starts over with
  741.                              the  first  pattern  in the AWK pro-
  742.                              gram. If the end of the  input  data
  743.                              is  reached,  the  END  block(s), if
  744.                              any, are executed.
  745.  
  746.        next file             Stop processing  the  current  input
  747.                              file.   The  next  input record read
  748.                              comes  from  the  next  input  file.
  749.                              FILENAME is updated, FNR is reset to
  750.                              1, and processing starts  over  with
  751.                              the  first  pattern  in the AWK pro-
  752.                              gram. If the end of the  input  data
  753.                              is  reached,  the  END  block(s), if
  754.                              any, are executed.
  755.  
  756.        print                 Prints the current record.
  757.  
  758.        print expr-list       Prints expressions.
  759.  
  760.        print expr-list >file Prints expressions on file.
  761.  
  762.        printf fmt, expr-list Format and print.
  763.  
  764.        printf fmt, expr-list >file
  765.                              Format and print on file.
  766.  
  767.        system(cmd-line)      Execute the  command  cmd-line,  and
  768.                              return  the  exit status.  (This may
  769.                              not be available on  non-POSIX  sys-
  770.                              tems.)
  771.  
  772.        Other  input/output  redirections  are  also  allowed. For
  773.        print and printf, >>file appends output to the file, while
  774.        | command writes on a pipe.  In a similar fashion, command
  775.        | getline pipes into getline.  Getline will  return  0  on
  776.        end of file, and -1 on an error.
  777.  
  778.    The printf Statement
  779.        The  AWK  versions  of  the printf statement and sprintf()
  780.        function (see below) accept the following conversion spec-
  781.        ification formats:
  782.  
  783.        %c     An ASCII character.  If the argument used for %c is
  784.               numeric, it is treated as a character and  printed.
  785.               Otherwise,  the argument is assumed to be a string,
  786.               and the only first  character  of  that  string  is
  787.  
  788.  
  789.  
  790. Free Software Foundation   Apr 15 1993                         12
  791.  
  792.  
  793.  
  794.  
  795.  
  796. GAWK(1)                  Utility Commands                 GAWK(1)
  797.  
  798.  
  799.               printed.
  800.  
  801.        %d     A decimal number (the integer part).
  802.  
  803.        %i     Just like %d.
  804.  
  805.        %e     A    floating    point    number    of   the   form
  806.               [-]d.ddddddE[+-]dd.
  807.  
  808.        %f     A floating point number of the form  [-]ddd.dddddd.
  809.  
  810.        %g     Use  e  or f conversion, whichever is shorter, with
  811.               nonsignificant zeros suppressed.
  812.  
  813.        %o     An unsigned octal number (again, an integer).
  814.  
  815.        %s     A character string.
  816.  
  817.        %x     An unsigned hexadecimal number (an integer).
  818.  
  819.        %X     Like %x, but using ABCDEF instead of abcdef.
  820.  
  821.        %%     A single % character; no argument is converted.
  822.  
  823.        There are optional, additional  parameters  that  may  lie
  824.        between the % and the control letter:
  825.  
  826.        -      The  expression should be left-justified within its
  827.               field.
  828.  
  829.        width  The field should be padded to this  width.  If  the
  830.               number  has  a leading zero, then the field will be
  831.               padded with zeros.  Otherwise  it  is  padded  with
  832.               blanks.
  833.  
  834.        .prec  A number indicating the maximum width of strings or
  835.               digits to the right of the decimal point.
  836.  
  837.        The dynamic width and prec  capabilities  of  the  ANSI  C
  838.        printf()  routines  are supported.  A * in place of either
  839.        the width or prec specifications will cause  their  values
  840.        to be taken from the argument list to printf or sprintf().
  841.  
  842.    Special File Names
  843.        When doing I/O redirection from  either  print  or  printf
  844.        into  a  file, or via getline from a file, gawk recognizes
  845.        certain special  filenames  internally.   These  filenames
  846.        allow  access  to  open  file  descriptors  inherited from
  847.        gawk's parent process (usually the shell).  Other  special
  848.        filenames  provide  access  information  about the running
  849.        gawk process.  The filenames are:
  850.  
  851.        /dev/pid    Reading this file returns the  process  ID  of
  852.                    the  current  process,  in decimal, terminated
  853.  
  854.  
  855.  
  856. Free Software Foundation   Apr 15 1993                         13
  857.  
  858.  
  859.  
  860.  
  861.  
  862. GAWK(1)                  Utility Commands                 GAWK(1)
  863.  
  864.  
  865.                    with a newline.
  866.  
  867.        /dev/ppid   Reading this file returns the  parent  process
  868.                    ID  of the current process, in decimal, termi-
  869.                    nated with a newline.
  870.  
  871.        /dev/pgrpid Reading this file returns the process group ID
  872.                    of the current process, in decimal, terminated
  873.                    with a newline.
  874.  
  875.        /dev/user   Reading this file returns a single record ter-
  876.                    minated  with a newline.  The fields are sepa-
  877.                    rated with blanks.  $1 is  the  value  of  the
  878.                    getuid(2)  system call, $2 is the value of the
  879.                    geteuid(2) system call, $3 is the value of the
  880.                    getgid(2)  system call, and $4 is the value of
  881.                    the getegid(2) system call.  If there are  any
  882.                    additional  fields,  they  are  the  group IDs
  883.                    returned by  getgroups(2).   (Multiple  groups
  884.                    may not be supported on all systems.)
  885.  
  886.        /dev/stdin  The standard input.
  887.  
  888.        /dev/stdout The standard output.
  889.  
  890.        /dev/stderr The standard error output.
  891.  
  892.        /dev/fd/n   The   file   associated  with  the  open  file
  893.                    descriptor n.
  894.  
  895.        These are particularly  useful  for  error  messages.  For
  896.        example:
  897.  
  898.               print "You blew it!" > "/dev/stderr"
  899.  
  900.        whereas you would otherwise have to use
  901.  
  902.               print "You blew it!" | "cat 1>&2"
  903.  
  904.        These  file  names may also be used on the command line to
  905.        name data files.
  906.  
  907.    Numeric Functions
  908.        AWK has the following pre-defined arithmetic functions:
  909.  
  910.  
  911.        atan2(y, x) returns the arctangent of y/x in radians.
  912.  
  913.        cos(expr)   returns the cosine in radians.
  914.  
  915.        exp(expr)   the exponential function.
  916.  
  917.        int(expr)   truncates to integer.
  918.  
  919.  
  920.  
  921.  
  922. Free Software Foundation   Apr 15 1993                         14
  923.  
  924.  
  925.  
  926.  
  927.  
  928. GAWK(1)                  Utility Commands                 GAWK(1)
  929.  
  930.  
  931.        log(expr)   the natural logarithm function.
  932.  
  933.        rand()      returns a random number between 0 and 1.
  934.  
  935.        sin(expr)   returns the sine in radians.
  936.  
  937.        sqrt(expr)  the square root function.
  938.  
  939.        srand(expr) use expr as a new seed for the  random  number
  940.                    generator. If no expr is provided, the time of
  941.                    day will be used.  The  return  value  is  the
  942.                    previous seed for the random number generator.
  943.  
  944.    String Functions
  945.        AWK has the following pre-defined string functions:
  946.  
  947.  
  948.        gsub(r, s, t)           for each  substring  matching  the
  949.                                regular expression r in the string
  950.                                t, substitute the  string  s,  and
  951.                                return  the  number  of  substitu-
  952.                                tions.  If t is not supplied,  use
  953.                                $0.
  954.  
  955.        index(s, t)             returns  the index of the string t
  956.                                in the string s, or 0 if t is  not
  957.                                present.
  958.  
  959.        length(s)               returns  the  length of the string
  960.                                s, or the length of $0 if s is not
  961.                                supplied.
  962.  
  963.        match(s, r)             returns  the  position  in s where
  964.                                the regular expression  r  occurs,
  965.                                or 0 if r is not present, and sets
  966.                                the values of RSTART and  RLENGTH.
  967.  
  968.        split(s, a, r)          splits the string s into the array
  969.                                a on the regular expression r, and
  970.                                returns the number of fields. If r
  971.                                is omitted, FS is used instead.
  972.  
  973.        sprintf(fmt, expr-list) prints expr-list according to fmt,
  974.                                and  returns the resulting string.
  975.  
  976.        sub(r, s, t)            just like  gsub(),  but  only  the
  977.                                first    matching   substring   is
  978.                                replaced.
  979.  
  980.        substr(s, i, n)         returns the n-character  substring
  981.                                of s starting at i.  If n is omit-
  982.                                ted, the rest of s is used.
  983.  
  984.        tolower(str)            returns a copy of the string  str,
  985.  
  986.  
  987.  
  988. Free Software Foundation   Apr 15 1993                         15
  989.  
  990.  
  991.  
  992.  
  993.  
  994. GAWK(1)                  Utility Commands                 GAWK(1)
  995.  
  996.  
  997.                                with all the upper-case characters
  998.                                in str translated to their  corre-
  999.                                sponding  lower-case counterparts.
  1000.                                Non-alphabetic characters are left
  1001.                                unchanged.
  1002.  
  1003.        toupper(str)            returns  a copy of the string str,
  1004.                                with all the lower-case characters
  1005.                                in  str translated to their corre-
  1006.                                sponding upper-case  counterparts.
  1007.                                Non-alphabetic characters are left
  1008.                                unchanged.
  1009.  
  1010.    Time Functions
  1011.        Since one of the primary uses of AWK programs is  process-
  1012.        ing  log  files  that contain time stamp information, gawk
  1013.        provides the following two functions  for  obtaining  time
  1014.        stamps and formatting them.
  1015.  
  1016.  
  1017.        systime() returns the current time of day as the number of
  1018.                  seconds since the Epoch (Midnight  UTC,  January
  1019.                  1, 1970 on POSIX systems).
  1020.  
  1021.        strftime(format, timestamp)
  1022.                  formats timestamp according to the specification
  1023.                  in format.  The timestamp should be of the  same
  1024.                  form  as returned by systime().  If timestamp is
  1025.                  missing, the current time of day is  used.   See
  1026.                  the specification for the strftime() function in
  1027.                  ANSI C for the format conversions that are guar-
  1028.                  anteed to be available.  A public-domain version
  1029.                  of strftime(3) and a man page for it are shipped
  1030.                  with  gawk;  if  that  version was used to build
  1031.                  gawk, then all of the conversions  described  in
  1032.                  that man page are available to gawk.
  1033.  
  1034.    String Constants
  1035.        String  constants  in  AWK  are  sequences  of  characters
  1036.        enclosed between double quotes ("). Within  strings,  cer-
  1037.        tain escape sequences are recognized, as in C. These are:
  1038.  
  1039.  
  1040.        \\   A literal backslash.
  1041.  
  1042.        \a   The  ``alert'' character; usually the ASCII BEL char-
  1043.             acter.
  1044.  
  1045.        \b   backspace.
  1046.  
  1047.        \f   form-feed.
  1048.  
  1049.        \n   new line.
  1050.  
  1051.  
  1052.  
  1053.  
  1054. Free Software Foundation   Apr 15 1993                         16
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. GAWK(1)                  Utility Commands                 GAWK(1)
  1061.  
  1062.  
  1063.        \r   carriage return.
  1064.  
  1065.        \t   horizontal tab.
  1066.  
  1067.        \v   vertical tab.
  1068.  
  1069.        \xhex digits
  1070.             The character represented by the string of  hexadeci-
  1071.             mal  digits following the \x.  As in ANSI C, all fol-
  1072.             lowing hexadecimal digits are considered part of  the
  1073.             escape  sequence.  (This feature should tell us some-
  1074.             thing about language  design  by  committee.)   E.g.,
  1075.             "\x1B" is the ASCII ESC (escape) character.
  1076.  
  1077.        \ddd The  character  represented by the 1-, 2-, or 3-digit
  1078.             sequence of octal digits. E.g. "\033"  is  the  ASCII
  1079.             ESC (escape) character.
  1080.  
  1081.        \c   The literal character c.
  1082.  
  1083.        The escape sequences may also be used inside constant reg-
  1084.        ular expressions (e.g., /[ \t\f\n\r\v]/ matches whitespace
  1085.        characters).
  1086.  
  1087. FUNCTIONS
  1088.        Functions in AWK are defined as follows:
  1089.  
  1090.               function name(parameter list) { statements }
  1091.  
  1092.        Functions  are executed when called from within the action
  1093.        parts of regular pattern-action statements. Actual parame-
  1094.        ters supplied in the function call are used to instantiate
  1095.        the formal parameters declared in  the  function.   Arrays
  1096.        are  passed  by  reference,  other variables are passed by
  1097.        value.
  1098.  
  1099.        Since functions were not originally part of the  AWK  lan-
  1100.        guage, the provision for local variables is rather clumsy:
  1101.        They are declared as extra  parameters  in  the  parameter
  1102.        list.  The  convention is to separate local variables from
  1103.        real parameters by extra spaces in the parameter list. For
  1104.        example:
  1105.  
  1106.               function  f(p, q,     a, b) { # a & b are local
  1107.                              ..... }
  1108.  
  1109.               /abc/     { ... ; f(1, 2) ; ... }
  1110.  
  1111.        The  left  parenthesis  in  a function call is required to
  1112.        immediately follow the function name, without  any  inter-
  1113.        vening  white space.  This is to avoid a syntactic ambigu-
  1114.        ity with the  concatenation  operator.   This  restriction
  1115.        does not apply to the built-in functions listed above.
  1116.  
  1117.  
  1118.  
  1119.  
  1120. Free Software Foundation   Apr 15 1993                         17
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. GAWK(1)                  Utility Commands                 GAWK(1)
  1127.  
  1128.  
  1129.        Functions may call each other and may be recursive.  Func-
  1130.        tion parameters used as local variables are initialized to
  1131.        the  null string and the number zero upon function invoca-
  1132.        tion.
  1133.  
  1134.        The word func may be used in place of function.
  1135.  
  1136. EXAMPLES
  1137.        Print and sort the login names of all users:
  1138.  
  1139.             BEGIN     { FS = ":" }
  1140.                  { print $1 | "sort" }
  1141.  
  1142.        Count lines in a file:
  1143.  
  1144.                  { nlines++ }
  1145.             END  { print nlines }
  1146.  
  1147.        Precede each line by its number in the file:
  1148.  
  1149.             { print FNR, $0 }
  1150.  
  1151.        Concatenate and line number (a variation on a theme):
  1152.  
  1153.             { print NR, $0 }
  1154.  
  1155. SEE ALSO
  1156.        egrep(1)
  1157.  
  1158.        The AWK Programming Language,  Alfred  V.  Aho,  Brian  W.
  1159.        Kernighan, Peter J. Weinberger, Addison-Wesley, 1988. ISBN
  1160.        0-201-07981-X.
  1161.  
  1162.        The GAWK Manual, Edition 0.15, published by the Free Soft-
  1163.        ware Foundation, 1993.
  1164.  
  1165. POSIX COMPATIBILITY
  1166.        A  primary  goal  for gawk is compatibility with the POSIX
  1167.        standard, as well as with the latest version of UNIX  awk.
  1168.        To  this end, gawk incorporates the following user visible
  1169.        features which are not described in the AWK book, but  are
  1170.        part  of  awk  in System V Release 4, and are in the POSIX
  1171.        standard.
  1172.  
  1173.        The -v option for assigning variables before program  exe-
  1174.        cution  starts  is  new.   The book indicates that command
  1175.        line variable assignment happens when awk would  otherwise
  1176.        open  the  argument  as  a  file, which is after the BEGIN
  1177.        block is executed.  However, in  earlier  implementations,
  1178.        when  such  an  assignment appeared before any file names,
  1179.        the assignment would happen before  the  BEGIN  block  was
  1180.        run.   Applications  came  to  depend on this ``feature.''
  1181.        When awk was changed  to  match  its  documentation,  this
  1182.        option  was added to accomodate applications that depended
  1183.  
  1184.  
  1185.  
  1186. Free Software Foundation   Apr 15 1993                         18
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. GAWK(1)                  Utility Commands                 GAWK(1)
  1193.  
  1194.  
  1195.        upon the old behavior.  (This feature was agreed  upon  by
  1196.        both the AT&T and GNU developers.)
  1197.  
  1198.        The -W option for implementation specific features is from
  1199.        the POSIX standard.
  1200.  
  1201.        When processing arguments, gawk uses  the  special  option
  1202.        ``--''  to  signal  the end of arguments, and warns about,
  1203.        but otherwise ignores, undefined options.
  1204.  
  1205.        The AWK book does not define the return value of  srand().
  1206.        The  System V Release 4 version of UNIX awk (and the POSIX
  1207.        standard) has it return the seed it was  using,  to  allow
  1208.        keeping   track  of  random  number  sequences.  Therefore
  1209.        srand() in gawk also returns its current seed.
  1210.  
  1211.        Other new features are: The use  of  multiple  -f  options
  1212.        (from  MKS  awk); the ENVIRON array; the \a, and \v escape
  1213.        sequences (done originally  in  gawk  and  fed  back  into
  1214.        AT&T's);  the  tolower()  and toupper() built-in functions
  1215.        (from AT&T); and the ANSI C conversion  specifications  in
  1216.        printf (done first in AT&T's version).
  1217.  
  1218. GNU EXTENSIONS
  1219.        Gawk has some extensions to POSIX awk.  They are described
  1220.        in this section.  All the extensions described here can be
  1221.        disabled by invoking gawk with the -W compat option.
  1222.  
  1223.        The  following features of gawk are not available in POSIX
  1224.        awk.
  1225.  
  1226.               o The \x escape sequence.
  1227.  
  1228.               o The systime() and strftime() functions.
  1229.  
  1230.               o The special file names available for I/O redirec-
  1231.                 tion are not recognized.
  1232.  
  1233.               o The ARGIND and ERRNO variables are not special.
  1234.  
  1235.               o The  IGNORECASE variable and its side-effects are
  1236.                 not available.
  1237.  
  1238.               o The FIELDWIDTHS variable and  fixed  width  field
  1239.                 splitting.
  1240.  
  1241.               o No  path  search is performed for files named via
  1242.                 the -f option.  Therefore the AWKPATH environment
  1243.                 variable is not special.
  1244.  
  1245.               o The use of next file to abandon processing of the
  1246.                 current input file.
  1247.  
  1248.        The AWK book does not  define  the  return  value  of  the
  1249.  
  1250.  
  1251.  
  1252. Free Software Foundation   Apr 15 1993                         19
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. GAWK(1)                  Utility Commands                 GAWK(1)
  1259.  
  1260.  
  1261.        close()  function.   Gawk's close() returns the value from
  1262.        fclose(3), or pclose(3), when  closing  a  file  or  pipe,
  1263.        respectively.
  1264.  
  1265.        When  gawk is invoked with the -W compat option, if the fs
  1266.        argument to the -F option is ``t'', then FS will be set to
  1267.        the  tab  character.   Since this is a rather ugly special
  1268.        case, it is not the default behavior.  This behavior  also
  1269.        does not occur if -Wposix has been specified.
  1270.  
  1271. HISTORICAL FEATURES
  1272.        There  are  two features of historical AWK implementations
  1273.        that gawk supports.  First, it is  possible  to  call  the
  1274.        length()  built-in function not only with no argument, but
  1275.        even without parentheses!  Thus,
  1276.  
  1277.               a = length
  1278.  
  1279.        is the same as either of
  1280.  
  1281.               a = length()
  1282.               a = length($0)
  1283.  
  1284.        This feature is marked  as  ``deprecated''  in  the  POSIX
  1285.        standard,  and  gawk will issue a warning about its use if
  1286.        -Wlint is specified on the command line.
  1287.  
  1288.        The other feature is the use  of  the  continue  statement
  1289.        outside the body of a while, for, or do loop.  Traditional
  1290.        AWK implementations have treated such usage as  equivalent
  1291.        to  the  next  statement.  Gawk will support this usage if
  1292.        -Wposix has not been specified.
  1293.  
  1294. BUGS
  1295.        The -F option is not  necessary  given  the  command  line
  1296.        variable assignment feature; it remains only for backwards
  1297.        compatibility.
  1298.  
  1299.        If your system actually has support for  /dev/fd  and  the
  1300.        associated /dev/stdin, /dev/stdout, and /dev/stderr files,
  1301.        you may get different output from gawk than you would  get
  1302.        on  a  system  without  those files.  When gawk interprets
  1303.        these files internally,  it  synchronizes  output  to  the
  1304.        standard  output  with  output  to /dev/stdout, while on a
  1305.        system with those files, the output is actually to differ-
  1306.        ent open files.  Caveat Emptor.
  1307.  
  1308. VERSION INFORMATION
  1309.        This man page documents gawk, version 2.15.
  1310.  
  1311.        Starting  with  the  2.15 version of gawk, the -c, -V, -C,
  1312.        -a, and -e options of the 2.11 version are no longer  rec-
  1313.        ognized.
  1314.  
  1315.  
  1316.  
  1317.  
  1318. Free Software Foundation   Apr 15 1993                         20
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. GAWK(1)                  Utility Commands                 GAWK(1)
  1325.  
  1326.  
  1327. AUTHORS
  1328.        The  original  version of UNIX awk was designed and imple-
  1329.        mented  by  Alfred  Aho,  Peter  Weinberger,   and   Brian
  1330.        Kernighan  of AT&T Bell Labs. Brian Kernighan continues to
  1331.        maintain and enhance it.
  1332.  
  1333.        Paul Rubin and Jay Fenlason, of the Free Software  Founda-
  1334.        tion,  wrote gawk, to be compatible with the original ver-
  1335.        sion of awk distributed in  Seventh  Edition  UNIX.   John
  1336.        Woods  contributed  a number of bug fixes.  David Trueman,
  1337.        with contributions from Arnold Robbins, made gawk compati-
  1338.        ble with the new version of UNIX awk.
  1339.  
  1340.        The  initial  DOS  port  was done by Conrad Kwok and Scott
  1341.        Garfinkle.  Scott Deifik is the  current  DOS  maintainer.
  1342.        Pat  Rankin did the port to VMS, and Michal Jaegermann did
  1343.        the port to the Atari ST.
  1344.  
  1345. ACKNOWLEDGEMENTS
  1346.        Brian Kernighan of Bell Labs provided valuable  assistance
  1347.        during testing and debugging.  We thank him.
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384. Free Software Foundation   Apr 15 1993                         21
  1385.  
  1386.  
  1387.