21.07.2015 Views

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

312 <strong>G<strong>AWK</strong></strong>: <strong>Effective</strong> <strong>AWK</strong> <strong>Programming</strong>Logical ExpressionAn expression using the operators for logic, AND, OR, and NOT, written ‘&&’,‘||’, and ‘!’ in awk. Often called Boolean expressions, after the mathematicianwho pioneered this kind of mathematical logic.LvalueMatchingAn expression that can appear on the left side of an assignment operator. Inmost languages, lvalues can be variables or array elements. In awk, a fielddesignator can also be used as an lvalue.The act of testing a string against a regular expression. If the regexp describesthe contents of the string, it is said to match it.MetacharactersCharacters used within a regexp that do not stand for themselves. Instead,they denote regular expression operations, such as repetition, grouping, or alternation.Null StringA string with no characters in it. It is represented explicitly in awk programsby placing two double quote characters next to each other (""). It can appearin input data by having two successive occurrences of the field separator appearnext to each other.Number A numeric-valued data object. Modern awk implementations use doubleprecisionfloating-point to represent numbers. Very old awk implementationsuse single-precision floating-point.OctalBase-eight notation, where the digits are 0–7. Octal numbers are written in Cusing a leading ‘0’, to indicate their base. Thus, 013 is 11 (one times 8 plus 3).P1003.2 See “POSIX.”PatternPOSIXPrecedencePrivatePatterns tell awk which 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. Atypical pattern might compare the input record against a regular expression.(See Section 6.1 [Pattern Elements], page 96.)The name for a series of standards that specify a Portable Operating Systeminterface. The “IX” denotes the Unix heritage of these standards. The mainstandard of interest for awk users 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.”The order in which operations are performed when operators are used withoutexplicit parentheses.Variables and/or functions that are meant for use exclusively by library functionsand not for the main awk program. Special care must be taken whennaming such variables and functions. (See Section 12.1 [Naming Library FunctionGlobal Variables], page 186.)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!