home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / info / gawk.info-7 (.txt) < prev    next >
GNU Info File  |  1994-12-22  |  50KB  |  924 lines

  1. This is Info file gawk.info, produced by Makeinfo-1.55 from the input
  2. file /gnu/src/amiga/gawk-2.15.5/gawk.texi.
  3.    This file documents `awk', a program that you can use to select
  4. particular records in a file and perform operations upon them.
  5.    This is Edition 0.15 of `The GAWK Manual',
  6. for the 2.15 version of the GNU implementation
  7. of AWK.
  8.    Copyright (C) 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that
  14. the entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that this permission notice may be stated in a
  19. translation approved by the Foundation.
  20. File: gawk.info,  Node: V7/S5R3.1,  Next: S5R4,  Prev: Language History,  Up: Language History
  21. Major Changes between V7 and S5R3.1
  22. ===================================
  23.    The `awk' language evolved considerably between the release of
  24. Version 7 Unix (1978) and the new version first made widely available in
  25. System V Release 3.1 (1987).  This section summarizes the changes, with
  26. cross-references to further details.
  27.    * The requirement for `;' to separate rules on a line (*note `awk'
  28.      Statements versus Lines: Statements/Lines.).
  29.    * User-defined functions, and the `return' statement (*note
  30.      User-defined Functions: User-defined.).
  31.    * The `delete' statement (*note The `delete' Statement: Delete.).
  32.    * The `do'-`while' statement (*note The `do'-`while' Statement: Do
  33.      Statement.).
  34.    * The built-in functions `atan2', `cos', `sin', `rand' and `srand'
  35.      (*note Numeric Built-in Functions: Numeric Functions.).
  36.    * The built-in functions `gsub', `sub', and `match' (*note Built-in
  37.      Functions for String Manipulation: String Functions.).
  38.    * The built-in functions `close', which closes an open file, and
  39.      `system', which allows the user to execute operating system
  40.      commands (*note Built-in Functions for Input/Output: I/O
  41.      Functions.).
  42.    * The `ARGC', `ARGV', `FNR', `RLENGTH', `RSTART', and `SUBSEP'
  43.      built-in variables (*note Built-in Variables::.).
  44.    * The conditional expression using the operators `?' and `:' (*note
  45.      Conditional Expressions: Conditional Exp.).
  46.    * The exponentiation operator `^' (*note Arithmetic Operators:
  47.      Arithmetic Ops.) and its assignment operator form `^=' (*note
  48.      Assignment Expressions: Assignment Ops.).
  49.    * C-compatible operator precedence, which breaks some old `awk'
  50.      programs (*note Operator Precedence (How Operators Nest):
  51.      Precedence.).
  52.    * Regexps as the value of `FS' (*note Specifying how Fields are
  53.      Separated: Field Separators.), and as the third argument to the
  54.      `split' function (*note Built-in Functions for String
  55.      Manipulation: String Functions.).
  56.    * Dynamic regexps as operands of the `~' and `!~' operators (*note
  57.      How to Use Regular Expressions: Regexp Usage.).
  58.    * Escape sequences (*note Constant Expressions: Constants.) in
  59.      regexps.
  60.    * The escape sequences `\b', `\f', and `\r' (*note Constant
  61.      Expressions: Constants.).
  62.    * Redirection of input for the `getline' function (*note Explicit
  63.      Input with `getline': Getline.).
  64.    * Multiple `BEGIN' and `END' rules (*note `BEGIN' and `END' Special
  65.      Patterns: BEGIN/END.).
  66.    * Simulated multi-dimensional arrays (*note Multi-dimensional
  67.      Arrays: Multi-dimensional.).
  68. File: gawk.info,  Node: S5R4,  Next: POSIX,  Prev: V7/S5R3.1,  Up: Language History
  69. Changes between S5R3.1 and S5R4
  70. ===============================
  71.    The System V Release 4 version of Unix `awk' added these features
  72. (some of which originated in `gawk'):
  73.    * The `ENVIRON' variable (*note Built-in Variables::.).
  74.    * Multiple `-f' options on the command line (*note Invoking `awk':
  75.      Command Line.).
  76.    * The `-v' option for assigning variables before program execution
  77.      begins (*note Invoking `awk': Command Line.).
  78.    * The `--' option for terminating command line options.
  79.    * The `\a', `\v', and `\x' escape sequences (*note Constant
  80.      Expressions: Constants.).
  81.    * A defined return value for the `srand' built-in function (*note
  82.      Numeric Built-in Functions: Numeric Functions.).
  83.    * The `toupper' and `tolower' built-in string functions for case
  84.      translation (*note Built-in Functions for String Manipulation:
  85.      String Functions.).
  86.    * A cleaner specification for the `%c' format-control letter in the
  87.      `printf' function (*note Using `printf' Statements for Fancier
  88.      Printing: Printf.).
  89.    * The ability to dynamically pass the field width and precision
  90.      (`"%*.*d"') in the argument list of the `printf' function (*note
  91.      Using `printf' Statements for Fancier Printing: Printf.).
  92.    * The use of constant regexps such as `/foo/' as expressions, where
  93.      they are equivalent to use of the matching operator, as in `$0 ~
  94.      /foo/' (*note Constant Expressions: Constants.).
  95. File: gawk.info,  Node: POSIX,  Next: POSIX/GNU,  Prev: S5R4,  Up: Language History
  96. Changes between S5R4 and POSIX `awk'
  97. ====================================
  98.    The POSIX Command Language and Utilities standard for `awk'
  99. introduced the following changes into the language:
  100.    * The use of `-W' for implementation-specific options.
  101.    * The use of `CONVFMT' for controlling the conversion of numbers to
  102.      strings (*note Conversion of Strings and Numbers: Conversion.).
  103.    * The concept of a numeric string, and tighter comparison rules to go
  104.      with it (*note Comparison Expressions: Comparison Ops.).
  105.    * More complete documentation of many of the previously undocumented
  106.      features of the language.
  107. File: gawk.info,  Node: POSIX/GNU,  Prev: POSIX,  Up: Language History
  108. Extensions in `gawk' not in POSIX `awk'
  109. =======================================
  110.    The GNU implementation, `gawk', adds these features:
  111.    * The `AWKPATH' environment variable for specifying a path search for
  112.      the `-f' command line option (*note Invoking `awk': Command Line.).
  113.    * The various `gawk' specific features available via the `-W'
  114.      command line option (*note Invoking `awk': Command Line.).
  115.    * The `ARGIND' variable, that tracks the movement of `FILENAME'
  116.      through `ARGV'.  (*note Built-in Variables::.).
  117.    * The `ERRNO' variable, that contains the system error message when
  118.      `getline' returns -1, or when `close' fails.  (*note Built-in
  119.      Variables::.).
  120.    * The `IGNORECASE' variable and its effects (*note Case-sensitivity
  121.      in Matching: Case-sensitivity.).
  122.    * The `FIELDWIDTHS' variable and its effects (*note Reading
  123.      Fixed-width Data: Constant Size.).
  124.    * The `next file' statement for skipping to the next data file
  125.      (*note The `next file' Statement: Next File Statement.).
  126.    * The `systime' and `strftime' built-in functions for obtaining and
  127.      printing time stamps (*note Functions for Dealing with Time
  128.      Stamps: Time Functions.).
  129.    * The `/dev/stdin', `/dev/stdout', `/dev/stderr', and `/dev/fd/N'
  130.      file name interpretation (*note Standard I/O Streams: Special
  131.      Files.).
  132.    * The `-W compat' option to turn off these extensions (*note
  133.      Invoking `awk': Command Line.).
  134.    * The `-W posix' option for full POSIX compliance (*note Invoking
  135.      `awk': Command Line.).
  136. File: gawk.info,  Node: Installation,  Next: Gawk Summary,  Prev: Language History,  Up: Top
  137. Installing `gawk'
  138. *****************
  139.    This chapter provides instructions for installing `gawk' on the
  140. various platforms that are supported by the developers.  The primary
  141. developers support Unix (and one day, GNU), while the other ports were
  142. contributed.  The file `ACKNOWLEDGMENT' in the `gawk' distribution
  143. lists the electronic mail addresses of the people who did the
  144. respective ports.
  145. * Menu:
  146. * Gawk Distribution::           What is in the `gawk' distribution.
  147. * Unix Installation::           In