|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
awkstatements attached to a rule. If the rule's pattern matches an input record,
awkexecutes the rule's action. Actions are always enclosed in curly braces. See section Overview of Actions.
awkscripts. It is thousands of lines long, including machine descriptions for several eight-bit microcomputers. It is a good example of a program that would have been better written in another language.
awkexpression that changes the value of some
awkvariable or data object. An object that you can assign to is called an lvalue. The assigned values are called rvalues. See section Assignment Expressions.
awkprograms are written.
awkprogram consists of a series of patterns and actions, collectively known as rules. For each input record given to the program, the program's rules are all processed in turn.
awkprograms may also contain function definitions.
zsh) are generally upwardly compatible with the Bourne shell.
awklanguage provides built-in functions that perform various numerical, time stamp related, and string computations. Examples are
sqrt(for the square root of a number) and
substr(for a substring of a string). See section Built-in Functions.
SUBSEP, are the variables that have special meaning to
awk. Changing some of them affects
awk's running environment. Several of these variables are specific to
gawk. See section 10. Built-in Variables.
awkprogramming language has C-like syntax, and this Info file points out similarities between
awkand C when appropriate.
picthat reads descriptions of molecules and produces
picinput for drawing them. It was written in
awkby Brian Kernighan and Jon Bentley, and is available from email@example.com.
awkstatements, enclosed in curly braces. Compound statements may be nested. See section Control Statements in Actions.
forstatements, and in patterns to select which input records to process. See section Variable Typing and Comparison Expressions.
awkfor delimiting actions, compound statements, and function bodies.
awkstores numeric values. It is the C type
"foo", but it may also be an expression whose value can vary. See section Using Dynamic Regexps.
=val, that each program has available to it. Users generally place values into the environment in order to provide information to various programs. Typical examples are the environment variables
awkreads an input record, it splits the record into pieces separated by whitespace (or by a separator regexp which you can change by setting the built-in variable
FS). Such pieces are called fields. If the pieces are of fixed length, you can use the built-in variable
FIELDWIDTHSto describe their lengths. See section Specifying How Fields are Separated, and also see See section Reading Fixed-width Data.
printfstatement. Also, data conversions from numbers to strings are controlled by the format string contained in the built-in variable
CONVFMT. See section Format-Control Letters.
awkhas a number of built-in functions, and also allows you to define your own. See section Built-in Functions, and User-defined Functions.
gawkand its source code may be distributed. (see section GNU GENERAL PUBLIC LICENSE)
F, with `A' representing 10, `B' representing 11, and so on up to `F' for 15. Hexadecimal numbers are written in C using a leading `0x', to indicate their base. Thus,
0x12is 18 (one times 16 plus 2).
awk. Usually, an
awkinput record consists of one line of text. See section How Input is Split into Records.
awklanguage, a keyword is a word that has special meaning. Keywords are reserved and may not be used as variable names.
gawk's keywords are:
awk. Often called Boolean expressions, after the mathematician who pioneered this kind of mathematical logic.
awk, a field designator can also be used as an lvalue.
awkprograms by placing two double-quote characters next to each other (
""). It can appear in input data by having two successive occurrences of the field separator appear next to each other.
gawkimplementation uses double precision floating point to represent numbers. Very old
awkimplementations use single precision floating point.
7. Octal numbers are written in C using a leading `0', to indicate their base. Thus,
013is 11 (one times 8 plus 3).
awkwhich input records are interesting to which rules.
A pattern is an arbitrary conditional expression against which input is tested. If the condition is satisfied, the pattern is said to match the input record. A typical pattern might compare the input record against a regular expression. See section Pattern Elements.
awkusers is IEEE Standard for Information Technology, Standard 1003.2-1992, Portable Operating System Interface (POSIX) Part 2: Shell and Utilities. Informally, this standard is often referred to as simply "P1003.2."
awkprogram. Special care must be taken when naming such variables and functions. See section Naming Library Function Global Variables.
awkto process, or it can specify single lines. See section Pattern Elements.
You can redirect the output of the
to a file or a system command, using the `>', `>>', and `|'
operators. You can redirect input to the
getline statement using
the `<' and `|' operators.
See section Redirecting Output of
and Explicit Input with
awk, regexps are used in patterns and in conditional expressions. Regexps may contain escape sequences. See section Regular Expressions.
/foo/. This regular expression is chosen when you write the
awkprogram, and cannot be changed doing its execution. See section How to Use Regular Expressions.
awkprogram that specifies how to process single input records. A rule consists of a pattern and an action.
awkreads an input record; then, for each rule, if the input record satisfies the rule's pattern,
awkexecutes the rule's action. Otherwise, the rule does nothing for that input record.
awk, essentially every expression has a value. These values are rvalues.
awklogical operators `&&' and `||'. If the value of the entire expression can be deduced from evaluating just the left-hand side of these operators, the right-hand side will not be evaluated (see section Boolean Expressions).
awkto store numeric values. It is the C type
gawk, instead of being handed directly to the underlying operating system. For example, `/dev/stderr'. See section Special File Names in
awklanguage, and may contain escape sequences. See section 4.2 Escape Sequences.
|[ << ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|