home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
gnu
/
gawk-2.15.5-src.lha
/
gawk-2.15.5
/
gawk.info-7
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-06-12
|
50KB
|
924 lines
This is Info file gawk.info, produced by Makeinfo-1.55 from the input
file /gnu/src/amiga/gawk-2.15.5/gawk.texi.
This file documents `awk', a program that you can use to select
particular records in a file and perform operations upon them.
This is Edition 0.15 of `The GAWK Manual',
for the 2.15 version of the GNU implementation
of AWK.
Copyright (C) 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Foundation.
File: gawk.info, Node: V7/S5R3.1, Next: S5R4, Prev: Language History, Up: Language History
Major Changes between V7 and S5R3.1
===================================
The `awk' language evolved considerably between the release of
Version 7 Unix (1978) and the new version first made widely available in
System V Release 3.1 (1987). This section summarizes the changes, with
cross-references to further details.
* The requirement for `;' to separate rules on a line (*note `awk'
Statements versus Lines: Statements/Lines.).
* User-defined functions, and the `return' statement (*note
User-defined Functions: User-defined.).
* The `delete' statement (*note The `delete' Statement: Delete.).
* The `do'-`while' statement (*note The `do'-`while' Statement: Do
Statement.).
* The built-in functions `atan2', `cos', `sin', `rand' and `srand'
(*note Numeric Built-in Functions: Numeric Functions.).
* The built-in functions `gsub', `sub', and `match' (*note Built-in
Functions for String Manipulation: String Functions.).
* The built-in functions `close', which closes an open file, and
`system', which allows the user to execute operating system
commands (*note Built-in Functions for Input/Output: I/O
Functions.).
* The `ARGC', `ARGV', `FNR', `RLENGTH', `RSTART', and `SUBSEP'
built-in variables (*note Built-in Variables::.).
* The conditional expression using the operators `?' and `:' (*note
Conditional Expressions: Conditional Exp.).
* The exponentiation operator `^' (*note Arithmetic Operators:
Arithmetic Ops.) and its assignment operator form `^=' (*note
Assignment Expressions: Assignment Ops.).
* C-compatible operator precedence, which breaks some old `awk'
programs (*note Operator Precedence (How Operators Nest):
Precedence.).
* Regexps as the value of `FS' (*note Specifying how Fields are
Separated: Field Separators.), and as the third argument to the
`split' function (*note Built-in Functions for String
Manipulation: String Functions.).
* Dynamic regexps as operands of the `~' and `!~' operators (*note
How to Use Regular Expressions: Regexp Usage.).
* Escape sequences (*note Constant Expressions: Constants.) in
regexps.
* The escape sequences `\b', `\f', and `\r' (*note Constant
Expressions: Constants.).
* Redirection of input for the `getline' function (*note Explicit
Input with `getline': Getline.).
* Multiple `BEGIN' and `END' rules (*note `BEGIN' and `END' Special
Patterns: BEGIN/END.).
* Simulated multi-dimensional arrays (*note Multi-dimensional
Arrays: Multi-dimensional.).
File: gawk.info, Node: S5R4, Next: POSIX, Prev: V7/S5R3.1, Up: Language History
Changes between S5R3.1 and S5R4
===============================
The System V Release 4 version of Unix `awk' added these features
(some of which originated in `gawk'):
* The `ENVIRON' variable (*note Built-in Variables::.).
* Multiple `-f' options on the command line (*note Invoking `awk':
Command Line.).
* The `-v' option for assigning variables before program execution
begins (*note Invoking `awk': Command Line.).
* The `--' option for terminating command line options.
* The `\a', `\v', and `\x' escape sequences (*note Constant
Expressions: Constants.).
* A defined return value for the `srand' built-in function (*note
Numeric Built-in Functions: Numeric Functions.).
* The `toupper' and `tolower' built-in string functions for case
translation (*note Built-in Functions for String Manipulation:
String Functions.).
* A cleaner specification for the `%c' format-control letter in the
`printf' function (*note Using `printf' Statements for Fancier
Printing: Printf.).
* The ability to dynamically pass the field width and precision
(`"%*.*d"') in the argument list of the `printf' function (*note
Using `printf' Statements for Fancier Printing: Printf.).
* The use of constant regexps such as `/foo/' as expressions, where
they are equivalent to use of the matching operator, as in `$0 ~
/foo/' (*note Constant Expressions: Constants.).
File: gawk.info, Node: POSIX, Next: POSIX/GNU, Prev: S5R4, Up: Language History
Changes between S5R4 and POSIX `awk'
====================================
The POSIX Command Language and Utilities standard for `awk'
introduced the following changes into the language:
* The use of `-W' for implementation-specific options.
* The use of `CONVFMT' for controlling the conversion of numbers to
strings (*note Conversion of Strings and Numbers: Conversion.).
* The concept of a numeric string, and tighter comparison rules to go
with it (*note Comparison Expressions: Comparison Ops.).
* More complete documentation of many of the previously undocumented
features of the language.
File: gawk.info, Node: POSIX/GNU, Prev: POSIX, Up: Language History
Extensions in `gawk' not in POSIX `awk'
=======================================
The GNU implementation, `gawk', adds these features:
* The `AWKPATH' environment variable for specifying a path search for
the `-f' command line option (*note Invoking `awk': Command Line.).
* The various `gawk' specific features available via the `-W'
command line option (*note Invoking `awk': Command Line.).
* The `ARGIND' variable, that tracks the movement of `FILENAME'
through `ARGV'. (*note Built-in Variables::.).
* The `ERRNO' variable, that contains the system error message when
`getline' returns -1, or when `close' fails. (*note Built-in
Variables::.).
* The `IGNORECASE' variable and its effects (*note Case-sensitivity
in Matching: Case-sensitivity.).
* The `FIELDWIDTHS' variable and its effects (*note Reading
Fixed-width Data: Constant Size.).
* The `next file' statement for skipping to the next data file
(*note The `next file' Statement: Next File Statement.).
* The `systime' and `strftime' built-in functions for obtaining and
printing time stamps (*note Functions for Dealing with Time
Stamps: Time Functions.).
* The `/dev/stdin', `/dev/stdout', `/dev/stderr', and `/dev/fd/N'
file name interpretation (*note Standard I/O Streams: Special
Files.).
* The `-W compat' option to turn off these extensions (*note
Invoking `awk': Command Line.).
* The `-W posix' option for full POSIX compliance (*note Invoking
`awk': Command Line.).
File: gawk.info, Node: Installation, Next: Gawk Summary, Prev: Language History, Up: Top
Installing `gawk'
*****************
This chapter provides instructions for installing `gawk' on the
various platforms that are supported by the developers. The primary
developers support Unix (and one day, GNU), while the other ports were
contributed. The file `ACKNOWLEDGMENT' in the `gawk' distribution
lists the electronic mail addresses of the people who did the
respective ports.
* Menu:
* Gawk Distribution:: What is in the `gawk' distribution.
* Unix Installation:: In