Symbols
- ! (exclamation mark)
- != (not equal) operator, Changing the Contents of a Field, Comparison operators, Operator Precedence (How Operators Nest)
- !~ operator, How to Use Regular Expressions, Using Dynamic Regexps, Regular expression constants, Comparison operators, Operator Precedence (How Operators Nest), Expressions as Patterns
- not operator, Boolean Expressions, Operator Precedence (How Operators Nest), Searching for Regular Expressions in Files
- " (quotation marks, double)
- denoting null strings, Shell Quoting Issues
- enclosing string constants, Numeric and string constants
- escaping in string constants, Escape Sequences
- mixing with single quotes, Shell Quoting Issues
- shell rules for, Shell Quoting Issues
- # (number sign)
- #! script mechanism, Executable awk Programs, Running the Example Programs
- format specification modifiers, Modifiers for printf Formats
- prefacing awk comments, Comments in awk Programs
- $ (dollar sign)
- $0 value
- in BEGIN and END rules, Input/output from BEGIN and END rules
- set by getline, Using getline with No Arguments
- understanding, Changing the Contents of a Field
- end-of-string matching in regular
expressions, Regular Expression Operators, Record Splitting with gawk
- field references in awk, Examining Fields, Operator Precedence (How Operators Nest)
- % (percent sign)
- %= (modulus and assignment) operator, Assignment Expressions, Operator Precedence (How Operators Nest)
- remainder operator, Arithmetic Operators, Operator Precedence (How Operators Nest)
- & (ampersand)
- && (Boolean and) operator, Boolean Expressions, Operator Precedence (How Operators Nest)
- with sub(), gsub(), and gensub() functions, More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- ' (quotation marks, single), Running Long Programs, Comments in awk Programs
- enclosing awk program on command line, One-Shot Throwaway awk Programs
- mixing with double quotes, Shell Quoting Issues
- modifier for printf formats, Modifiers for printf Formats
- ' operator, gawk-Specific Regexp Operators
- ( ) (parentheses)
- function arguments in, Function Calls
- grouping with, Regular Expression Operators, Operator Precedence (How Operators Nest)
- in functions, Calling Built-in Functions
- using in string concatenation, String Concatenation
- * (asterisk)
- ** (exponentiation) operator, Arithmetic Operators, Operator Precedence (How Operators Nest)
- **= (exponentiation and assignment) operator, Assignment Expressions, Operator Precedence (How Operators Nest)
- *= (multiplication and assignment) operator, Assignment Expressions, Operator Precedence (How Operators Nest)
- multiplication operator, Nonconstant Field Numbers, Arithmetic Operators, Operator Precedence (How Operators Nest)
- regular expression metacharacter, Regular Expression Operators
- using with positional specifiers, Rearranging printf Arguments
- + (plus sign)
- ++ (increment) operator, Points to Remember About getline, Increment and Decrement Operators, Operator Precedence (How Operators Nest), The while Statement, Counting Things
- += (addition and assignment) operator, Assignment Expressions, Operator Precedence (How Operators Nest), Counting Things
- addition operator, Arithmetic Operators, Operator Precedence (How Operators Nest)
- regular expression metacharacter, Regular Expression Operators
- unary plus operator, Arithmetic Operators, Operator Precedence (How Operators Nest)
- used before width modifier, Modifiers for printf Formats
- , (comma)
- as decimal point character, Locales can influence conversion
- separating fields, Specifying How Fields Are Separated
- - (hyphen)
- -- (decrement) operator, Increment and Decrement Operators, Operator Precedence (How Operators Nest)
- -- option, Command-Line Options, Using ARGC and ARGV
- -= (subtraction and assignment) operator, Assignment Expressions, Operator Precedence (How Operators Nest)
- beginning command-line options, Command-Line Options
- denoting ranges in bracket expressions, Using Bracket Expressions
- naming standard input, Naming Standard Input
- subtraction operator, Changing the Contents of a Field, Arithmetic Operators, Operator Precedence (How Operators Nest)
- unary minus operator, Arithmetic Operators, Operator Precedence (How Operators Nest)
- used before width modifier, Modifiers for printf Formats
- . (dot)
- as decimal point character, Locales can influence conversion
- in path entry, The AWKPATH Environment Variable
- matching any single character in regular
expressions, Regular Expression Operators
- / (forward slash)
- /= (division and assignment) operator, Assignment Expressions, Operator Precedence (How Operators Nest)
- division operator, Arithmetic Operators, Operator Precedence (How Operators Nest)
- enclosing regular expressions, Some Simple Examples, Regular Expressions
- escaping in regexp constants, Escape Sequences
- : (colon)
- :: empty field, Changing the Contents of a Field
- in search path, The AWKPATH Environment Variable
- ; (semicolon)
- in if-else statements, The if-else Statement
- separating statements or rules on a line, awk Statements Versus Lines
- < (left angle bracket)
- <= (less than or equal to) operator, Comparison operators, Operator Precedence (How Operators Nest)
- less than operator, Comparison operators, Operator Precedence (How Operators Nest)
- < operator, gawk-Specific Regexp Operators
- = (equals sign)
- == (equal to) operator, Field-Splitting Summary, Comparison operators, Operator Precedence (How Operators Nest)
- assignment operator, Record Splitting with Standard awk, Assignment Expressions, Operator Precedence (How Operators Nest)
- > (right angle bracket)
- > and >> (redirection) operators, Redirecting Output of print and printf, Operator Precedence (How Operators Nest)
- >= (greater than or equal to) operator, Comparison operators, Operator Precedence (How Operators Nest)
- greater than operator, Comparison operators, Operator Precedence (How Operators Nest)
- output done with >, Extracting Programs from Texinfo Source Files
- > operator, gawk-Specific Regexp Operators
- ? (question mark)
- ? : (conditional) operator, Conditional Expressions, Operator Precedence (How Operators Nest)
- regular expression metacharacter, Regular Expression Operators
- @ (at sign)
- @include keyword, Command-Line Options, Including Other Files into Your Program, Including Other Files into Your Program, Using getline into a Variable from a File, An Easy Way to Use Library Functions
- @load keyword, Loading Dynamic Extensions into Your Program, Integrating the Extensions, File-Related Functions
- separator character, removing from file, Extracting Programs from Texinfo Source Files
- [ ] (square brackets)
- array subscripting, Basic Array Example
- bracket expressions, Regular Expression Operators
- complemented, Regular Expression Operators
- using, Using Bracket Expressions
- (backslash)
- before regular characters, Escape Sequences
- continuing lines with, awk Statements Versus Lines
- escaping with \, Escape Sequences
- in bracket expressions, Using Bracket Expressions
- in escape sequences, Escape Sequences
- in regular expressions inside strings, Using Dynamic Regexps
- quoting characters, Shell Quoting Issues
- regular expression metacharacter, Regular Expression Operators
- use with sub(), gsub(), and gensub(),
functions, More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- ^ (caret)
- beginning-of-string matching in regular
expressions, Regular Expression Operators, Record Splitting with gawk, Using Regular Expressions to Separate Fields
- exponentiation operator, Arithmetic Operators, Operator Precedence (How Operators Nest)
- ^= (exponentiation and assignment) operator, Assignment Expressions, Operator Precedence (How Operators Nest)
- _ (underscore)
- gettext macro, GNU gettext
- in variable names, Naming Library Function Global Variables
- ` (grave accent)
- ` operator, gawk-Specific Regexp Operators
- { } (curly braces)
- enclosing awk statements, Actions
- enclosing interval expressions, Regular Expression Operators
- | (vertical bar)
- alternation operator, Regular Expression Operators
- opening two-way pipe to another process with |&
operator, Two-Way Communications with Another Process
- | and |& redirection operators, Redirecting Output of print and printf, Operator Precedence (How Operators Nest)
- |& operator communicating with
coprocess, Closing Input and Output Redirections
- || (Boolean or) operator, Boolean Expressions, Operator Precedence (How Operators Nest)
- ~ operator, How to Use Regular Expressions, Using Dynamic Regexps, Regular expression constants, Comparison operators, Operator Precedence (How Operators Nest), Expressions as Patterns
A
- a (alert character), Escape Sequences, Translating Between Characters and Numbers, An Alarm Clock Program, Changes Between SVR3.1 and SVR4
- accuracy, Other Stuff to Know
- actions, Getting Started with awk, Actions–Predefined Variables
- control statements in, Control Statements in Actions–Predefined Variables
- for BEGIN and END rules, The BEGIN and END Special Patterns
- omitting, Some Simple Examples
- Aho, Alfred V., History of awk and gawk
- alarm clock program, An Alarm Clock Program–Transliterating Characters
- alert character (a), Escape Sequences, Translating Between Characters and Numbers, An Alarm Clock Program, Changes Between SVR3.1 and SVR4
- alternation operator (|), Regular Expression Operators
- anagrams, finding, Finding Anagrams from a Dictionary
- anchors, Regular Expression Operators
- and operator (&&), Boolean Expressions, Operator Precedence (How Operators Nest)
- and() function (gawk), Bit-Manipulation Functions
- API, gawk extensions, Introduction, API Description–How gawk Finds Extensions
- accessing and updating function parameters, Accessing and Updating Parameters
- API variables, API Variables
- array manipulation, Array Manipulation
- boilerplate code, Boilerplate Code
- customized output wrappers, Customized output wrappers
- general-purpose data types, Introduction
- memory allocation functions and convenience
macros, Memory Allocation Functions and Convenience Macros
- printing messages, Printing Messages
- registration functions, Registration Functions
- symbol table access, Symbol Table Access
- tests, API Tests
- updating ERRNO variable, Updating ERRNO
- are_equal() function, Printing Nonduplicated Lines of Text
- ARGC variable, Other Command-Line Arguments, Built-in Variables That Convey Information
- using, Using ARGC and ARGV
- ARGIND variable, Other Command-Line Arguments, Built-in Variables That Convey Information, Rereading the Current File
- using to detect when empty datafile is
skipped, Checking for Zero-Length Files
- arguments, Function Calls
- for built-in functions, Calling Built-in Functions
- in parameter-list of function definitions, Function Definition Syntax
- omitted in function calls, Function Calls
- passing function arguments by value or by
reference, Passing function arguments by value or by reference
- ARGV array, Other Command-Line Arguments, Assigning variables on the command line, Built-in Variables That Convey Information
- ARGV[0], Executable awk Programs
- using, Using ARGC and ARGV
- arithmetic and arbitrary-precision arithmetic
(gawk), Arithmetic and Arbitrary-Precision Arithmetic with gawk–Summary
- arbitrary-precision arithmetic features, Arbitrary-Precision Arithmetic Features in gawk
- arbitrary-precision integer arithmetic, Arbitrary-Precision Integer Arithmetic with gawk
- computer arithmetic, general description of, A General Description of Computer Arithmetic
- floating-point arithmetic, Floating-Point Arithmetic: Caveat Emptor!–Setting the Rounding Mode
- forcing arbitrary-precision arithmetic with --bignum
option, Command-Line Options
- standards versus existing practice, Standards Versus Existing Practice
- terminology, Other Stuff to Know
- arithmetic operators, Arithmetic Operators
- array subscripts, Introduction to Arrays
- arrays, Arrays in awk–Summary
- assigning values to elements, Assigning Array Elements
- dumping and restoring, rwarray gawk extension, Dumping and Restoring an Array
- example, basic, Basic Array Example
- introduction to, Introduction to Arrays
- isarray() function, Getting Type Information
- iterating over indices, using for loop, The for Statement
- local to a function, Controlling variable scope
- manipulation in gawk extension API, Array Manipulation
- array data types, Array data types
- array functions, Array functions
- creating and populating arrays, How to create and populate arrays
- working with all elements of an array, Working with all the elements of an array
- merging into a string, Merging an Array into a String
- multidimensional, Multidimensional Arrays
- of arrays, Arrays of Arrays
- traversing, Traversing Arrays of Arrays–Summary
- processing, using indirect function calls, Traversing Arrays of Arrays
- referring to an element, Referring to an Array Element
- removing individual element, using delete
statement, The delete Statement
- scanning all elements of, Scanning All Elements of an Array
- sorting values and indices with gawk, Sorting Array Values and Indices with gawk
- subscripting
- using numbers, Using Numbers to Subscript Arrays
- using uninitialized variables, Using Uninitialized Variables as Subscripts
- subscripts in, Comparison operators
- traversal of, controlling in gawk, Controlling Array Traversal and Array Sorting–Sorting Array Values and Indices with gawk
- user-defined function deleting all elements, Function Definition Examples
- user-defined function returning value for largest
element, The return Statement
- using predefined array scanning orders with
gawk, Using Predefined Array Scanning Orders with gawk
- ASCII character set, Using Bracket Expressions, Translating Between Characters and Numbers
- asort() function (gawk), String-Manipulation Functions, Controlling Array Traversal and Array Sorting
- sorting arrays, Sorting Array Values and Indices with gawk
- asorti() function (gawk), String-Manipulation Functions, Controlling Array Traversal and Array Sorting
- sorting an array, Sorting Array Values and Indices with gawk
- assert() function
- C language, Assertions
- user-defined, Assertions
- assertions, Assertions
- assignment, Assignment Expressions
- assigning array elements, Assigning Array Elements
- assigning shell variable’s value to awk
variable, Using Shell Variables in Programs
- treating assignments as filenames, Treating Assignments as Filenames
- assignment operator (=), Record Splitting with Standard awk
- assignment operators, compound, Assignment Expressions, Operator Precedence (How Operators Nest)
- associative arrays, Introduction to Arrays
- atan2() function, Numeric Functions
- awk
- arithmetic operators, Arithmetic Operators
- built-in functions, Other Features of awk
- common uses of, Preface
- conversions between strings and numbers, How awk converts between strings and numbers
- evolution of, The Evolution of the awk Language–Summary
- changes between SVR3.1 and SVR4, Changes Between SVR3.1 and SVR4
- changes between SVR4 and POSIX awk, Changes Between SVR4 and POSIX awk
- common extensions summary, Common Extensions Summary
- extensions in gawk not in POSIX awk, Extensions in gawk Not in POSIX awk
- major changes between Version 7 and SVR3.1, Major Changes Between V7 and SVR3.1
- freely available implementations, Other Freely Available awk Implementations
- gawk (GNU implementation), Preface
- history of, History of awk and gawk
- invoking, Invoking awk
- predefined variables, Other Features of awk
- searching for patterns in text, Getting Started with awk
- standard input, naming, Naming Standard Input
- uses of, When to Use awk
- awk langauge, Using This Book
- awk programs, Using This Book
- comments in, Comments in awk Programs
- contents of, Actions
- example with two rules, An Example with Two Rules
- example, more complex, A More Complex Example
- examples, simple, Some Simple Examples
- internationalization (example), A Simple Internationalization Example–gawk Can Speak Your Language
- internationalizing, Internationalizing awk Programs
- practical, Practical awk Programs–Summary
- alarm clock program, An Alarm Clock Program–Transliterating Characters
- counting things, Counting Things–A Grab Bag of awk Programs
- cut utility, Cutting Out Fields and Columns–Cutting Out Fields and Columns
- duplicating output into multiple files, Duplicating Output into Multiple Files
- extracting programs from Texinfo source files, Extracting Programs from Texinfo Source Files–A Simple Stream Editor
- finding anagrams from a dictionary, Finding Anagrams from a Dictionary
- finding duplicated words in a document, Finding Duplicated Words in a Document
- generating word-usage counts, Generating Word-Usage Counts–Generating Word-Usage Counts
- printing mailing labels, Printing Mailing Labels–Generating Word-Usage Counts
- printing nonduplicated lines of text, Printing Nonduplicated Lines of Text–Printing Nonduplicated Lines of Text
- printing out user information, Printing Out User Information–Printing Out User Information
- removing duplicates from unsorted data, Removing Duplicates from Unsorted Text
- running example programs, Running the Example Programs
- searching for regexps in files, Searching for Regular Expressions in Files–Printing Out User Information
- simple stream editor, A Simple Stream Editor–A Simple Stream Editor
- splitting large file into pieces, Splitting a Large File into Pieces
- transliterating characters, Transliterating Characters–Transliterating Characters
- using library functions, An Easy Way to Use Library Functions–Finding Anagrams from a Dictionary
- profiling with gawk, Profiling Your awk Programs–Profiling Your awk Programs
- running, How to Run awk Programs
- executable scripts, Executable awk Programs
- long programs, Running Long Programs
- one-shot throwaway programs, One-Shot Throwaway awk Programs
- without input files, Running awk Without Input Files
- statements versus lines, awk Statements Versus Lines
- translating, Translating awk Programs–awk Portability Issues
- awk portability issues, awk Portability Issues
- awka, Other Freely Available awk Implementations
- AWKBUFSIZE environment variable, Other Environment Variables
- AWKLIBPATH environment variable, The AWKLIBPATH Environment Variable, Loading Dynamic Extensions into Your Program
- gawk extensions, Integrating the Extensions
- AWKPATH environment variable, The AWKPATH Environment Variable, An Easy Way to Use Library Functions
- using with @include keyword, Including Other Files into Your Program
- AWKREADFUNC environment variable, Other Environment Variables
- awk_bool_t sym_lookup_scalar() extension
function, Variable access and update by cookie
- awk_bool_t sym_update_scalar() extension
function, Variable access and update by cookie
- AWK_HASH environment variable, Other Environment Variables
- awk_input_buf_t struct, Customized input parsers
- awk_output_buf_t struct, Customized output wrappers
- awk_string_t struct, General-Purpose Data Types
- awk_valtype_t enum, General-Purpose Data Types
- awk_value_t struct, General-Purpose Data Types
B
- (backspace character), Escape Sequences
- b (break) command (debugger), Control of Breakpoints
- B operator, gawk-Specific Regexp Operators
- operator, gawk-Specific Regexp Operators
- -b option, Command-Line Options
- backspace character (), Escape Sequences
- backtrace command (debugger), Working with the Stack
- Bash shell
- search path, The AWKPATH Environment Variable
- set +H command, Running awk Without Input Files
- BEGIN rule, Some Simple Examples, Pattern Elements, The BEGIN and END Special Patterns, Noting Datafile Boundaries
- adding headings to table columns, Examples Using printf
- assigning value to FS variable, Specifying How Fields Are Separated
- changing value of RS variable, Record Splitting with Standard awk
- command-line variable assignments and, Other Command-Line Arguments
- input/output from, Input/output from BEGIN and END rules, Assertions
- next statement in, The next Statement
- printing headings for a table, print Statement Examples
- startup actions, Startup and cleanup actions
- BEGINFILE rule, Pattern Elements, The BEGINFILE and ENDFILE Special Patterns
- beginfile() user-defined function, Noting Datafile Boundaries, Searching for Regular Expressions in Files, Counting Things
- begpat, endpat, Pattern Elements
- specifying ranges of input records with, Specifying Record Ranges with Patterns
- --bignum option, Command-Line Options
- binary operators, Nonconstant Field Numbers
- bindtextdomain() function (gawk), String-Translation Functions, Internationalizing awk Programs
- BINMODE variable, Built-in Variables That Control awk, Using gawk on PC operating systems
- bit-manipulation functions, Bit-Manipulation Functions
- body-of-function (function definitions), Function Definition Syntax
- boilerplate code for gawk extension API macros, Boilerplate Code
- Boolean expressions, Boolean Expressions
- as patterns, Expressions as Patterns
- Bourne-style shells, POSIX-compliant
- quoting rules, Shell Quoting Issues
- bracket expressions
- character classes, Using Bracket Expressions
- complemented, Regular Expression Operators
- defined, Regular Expression Operators
- of dynamic regexps,
in, Using Dynamic Regexps
- using, Using Bracket Expressions
- break command (debugger), Control of Breakpoints
- break statement
- ending execution of for, while, or do loops, The break Statement
- in switch statements, The switch Statement
- breakpoints, Debugging Concepts
- control of, gawk debugger commands, Control of Breakpoints
- setting, Finding the Bug
- Brini, Davide, And Now for Something Completely Different
- bt (backtrace) command (debugger), Working with the Stack
- buffers
- controlling output buffering with system(), Input/Output Functions
- gawk extension API output buffers, Customized output wrappers
- I/O buffering and two-way pipes, issues
with, Two-Way Communications with Another Process
- interactive versus noninteractive output
buffering, Input/Output Functions
- operators in, gawk-Specific Regexp Operators
- bug reports (gawk), Reporting Problems and Bugs
- built-in functions, Function Calls, Built-in Functions–String-Translation Functions
- bit-manipulation, Bit-Manipulation Functions
- calling, Calling Built-in Functions
- getting type information, Getting Type Information
- input/output, Input/Output Functions
- numeric, Numeric Functions
- string-manipulation, String-Manipulation Functions–More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- string-translation, String-Translation Functions
- time, Time Functions
- Busybox awk, Other Freely Available awk Implementations
- BWK awk, Typographical Conventions
- extensions, Extensions in Brian Kernighan’s awk
- by value or by reference, passing function
arguments, Passing function arguments by value or by reference
C
- c (continue) command (debugger), Control of Execution
- C language
- assertions, Assertions
- code for chdir() and stat(), C Code for chdir() and stat()
- ctime() function, Function Definition Examples
- function pointers, qsort() function, Indirect Function Calls
- getopt() function, Processing Command-Line Options
- grcat program, Reading the Group Database
- group database, reading, Reading the Group Database
- password database, reading, Reading the User Database
- printf, Modifiers for printf Formats
- pwcat program, Reading the User Database
- strcoll() function, String comparison with POSIX rules
- subroutines for obtaining user information, Reading the User Database
- -c option, Command-Line Options
- -C option, Command-Line Options
- C shell
- ! as special character, Running awk Without Input Files
- backslash continuation, awk Statements Versus Lines
- setting POSIXLY_CORRECT variable, Command-Line Options
- cached values, creating and using in gawk extension
API, Creating and using cached values
- call stack, Debugging Concepts
- gawk debugger commands for working with, Working with the Stack
- carriage return character (
), Escape Sequences
- case sensitivity in matching, Case Sensitivity in Matching
- case statement, The switch Statement
- cat utility, Running awk Without Input Files
- CGI applications
- -E command-line option and, Command-Line Options
- @include keyword and, Including Other Files into Your Program
- character classes, Using Bracket Expressions, Summary
- (see also bracket expressions)
- defined by POSIX standard, summary of, Using Bracket Expressions
- character lists, Regular Expression Operators
- (see also bracket expressions)
- character sets, Translating Between Characters and Numbers
- characters
- translating between characters and numbers, Translating Between Characters and Numbers
- transliterating, Transliterating Characters–Transliterating Characters
- --characters-as-bytes
option, Command-Line Options
- chdir() function, Using chdir() and stat()
- C code for, C Code for chdir() and stat()
- in gawk filefuncs extension, File-Related Functions
- chmod utility, Executable awk Programs
- chr() extension function, Character and Numeric values: ord() and chr()
- chr() user-defined function, Translating Between Characters and Numbers, Splitting a Large File into Pieces
- clear command (debugger), Control of Breakpoints
- Cliff random number generator, The Cliff Random Number Generator
- close() function, Using getline into a Variable from a File
- closing input and output redirections, Closing Input and Output Redirections
- closing one end of a two-way pipe, Two-Way Communications with Another Process
- defined, Input/Output Functions
- return value and, Closing Input and Output Redirections
- code examples in this book, datafiles for, Datafiles for the Examples
- collating elements, Using Bracket Expressions
- collating order, string comparisons based on, String comparison with POSIX rules
- collating symbols, Using Bracket Expressions
- comma-separated values (CSV) data, Defining Fields by Content
- command interpreter (see shells)
- command line
- directories on, Directories on the Command Line
- invoking awk, Invoking awk
- variable assignment on, Record Splitting with Standard awk, Setting FS from the Command Line, Assigning variables on the command line
- disabling, Treating Assignments as Filenames
- command substitution, An Easy Way to Use Library Functions
- command-line arguments, Other Command-Line Arguments, Assigning variables on the command line
- ARGC variable, Built-in Variables That Convey Information
- getopt() function and, Processing Command-Line Options
- command-line options, Command-Line Options–Command-Line Options
- choosing options that don’t conflict with
gawk’s, Using ARGC and ARGV
- controlling how gawk interprets characters in
regexps, gawk-Specific Regexp Operators
- GNU-style long options, Command-Line Options
- information variables for, in gawk extension
API, Informational variables
- obsolete, Obsolete Options and/or Features
- POSIX-style, Invoking awk
- processing, getopt() functions for, Processing Command-Line Options–Processing Command-Line Options
- undocumented, Undocumented Options and Features
- variable assignment, Assigning variables on the command line
- commands
- closing redirection to command, Closing Input and Output Redirections
- executing operating system command, Input/Output Functions
- redirecting print output to command, Redirecting Output of print and printf
- redirection of print output to input of
command, Redirecting Output of print and printf
- commands command (debugger), Control of Execution
- comments
- backslash continuation and, awk Statements Versus Lines
- C-style, deletion from input, Using getline with No Arguments
- in awk programs, Comments in awk Programs
- comparison expressions, Expressions as Patterns
- kinds of comparisons awk performs and their
results, Comparison operators
- compatibility mode, Command-Line Options, Command-Line Options
- path searching and, The AWKPATH Environment Variable
- compiled languages, Executable awk Programs
- compiling gawk
- for Unix-like systems, Compiling gawk for Unix-Like Systems
- for Windows systems, Compiling gawk for PC operating systems
- on VMS, Compiling gawk on VMS
- gawk dynamic extensions, Compiling gawk dynamic extensions on VMS
- compl() function (gawk), Bit-Manipulation Functions
- computed regexps, Using Dynamic Regexps
- concatenating strings (see string concatenation)
- condition command (debugger), Control of Breakpoints
- conditional expressions, Conditional Expressions
- constants, Summary, Constants, Variables, and Conversions–Using Regular Expression Constants
- (see also regexp constants)
- gawk extension API version constants, API version constants and variables
- numeric, Numeric and string constants
- regexp, How to Use Regular Expressions, Regular expression constants
- string, Numeric and string constants
- string constants versus regexp constants, Using Dynamic Regexps
- types of, Constant Expressions
- constructor functions, gawk extension API, Constructor Functions
- continue command (debugger), Control of Execution
- continue statement, The continue Statement
- contributors to gawk, Major Contributors to gawk
- control characters, Typographical Conventions
- control statements, Control Statements in Actions–Predefined Variables
- continue, The continue Statement
- do-while, The do-while Statement
- exit, The exit Statement
- for, The for Statement
- if-else, The if-else Statement
- next, The next Statement
- nextfile, The nextfile Statement
- switch, The switch Statement
- while, The while Statement
- CONVFMT variable, How awk converts between strings and numbers, Built-in Variables That Control awk
- array subscripts and, Using Numbers to Subscript Arrays
- cookies
- scalar cookies in gawk extension API, General-Purpose Data Types
- variable access and update by, gawk extension
API, Variable access and update by cookie
- Coordinated Universal Time (UTC), Time Functions
- coprocesses
- opened with redirection, closing, Closing Input and Output Redirections
- redirecting print output to, Redirecting Output of print and printf
- two-way pipe to, operning with gawk, Two-Way Communications with Another Process
- using getline from, Using getline from a Coprocess
- using getline into a variable from, Using getline into a Variable from a Coprocess
- cos() function, Numeric Functions
- counting
- wc (word count) utility, Counting Things–A Grab Bag of awk Programs
- word-usage counts, generating, Generating Word-Usage Counts–Generating Word-Usage Counts
- CSV (comma-separated values) data, Defining Fields by Content
- ctime() user-defined function, Function Definition Examples
- cut utility, Cutting Out Fields and Columns–Cutting Out Fields and Columns
- Cygwin environment, using gawk in, Using gawk in the Cygwin environment
D
- d (delete) command (debugger), Control of Breakpoints
- -d option, Command-Line Options
- -D option, Command-Line Options, How to Start the Debugger
- dash (see - (hyphen), in Symbols section)
- databases
- reading the group database, Reading the Group Database–Reading the Group Database
- reading the user database, Reading the User Database–Reading the User Database
- datafiles
- for code examples in this book, Datafiles for the Examples
- functions for management of, Datafile Management
- checking for readable datafiles, Checking for Readable Datafiles
- checking for zero-length files, Checking for Zero-Length Files
- noting datafile boundaries, Noting Datafile Boundaries
- rereading the current file, Rereading the Current File
- treating assignments as filenames, Treating Assignments as Filenames
- unsorted, removing duplicates from, Removing Duplicates from Unsorted Text
- date utility
- awk implementation of, Time Functions
- gawk version of, Time Functions
- dates and time
- ctime() user-defined function, Function Definition Examples
- gawk extension time functions, Extension Time Functions
- getlocaltime() user-defined function, An Alarm Clock Program
- managing time of day, Managing the Time of Day
- time functions, Time Functions
- date format specifications in strftime()
function, Time Functions
- dcgettext() function (gawk), String-Translation Functions, Internationalizing awk Programs
- dcngettext() function (gawk), String-Translation Functions, Internationalizing awk Programs
- deadlock, Two-Way Communications with Another Process
- --debug option, Command-Line Options, How to Start the Debugger
- debuggers
- gawk debugger
- limitations of, Limitations
- main commands, Main Debugger Commands–Miscellaneous Commands
- starting, How to Start the Debugger
- GNU Debugger (GDB), Debugging awk Programs
- debugging, Debugging awk Programs–Summary
- awk programs, aspects not shared by other programming
languages, awk Debugging
- concepts applying to most debuggers, Debugging Concepts
- in general, Introduction to the gawk Debugger
- limitations of gawk debugger, Limitations
- main debugger commands, Main Debugger Commands
- control of breakpoints, Control of Breakpoints
- control of execution, Control of Execution
- getting information about program and debugger
state, Obtaining Information About the Program and the Debugger
State
- miscellaneous commands, Miscellaneous Commands
- viewing and changing data, Viewing and Changing Data
- working with the stack, Working with the Stack
- readline support, Readline Support
- sample session, Sample gawk Debugging Session–Finding the Bug
- finding the bug, Finding the Bug
- starting the gawk debugger, How to Start the Debugger
- decimal arithmetic, A General Description of Computer Arithmetic
- decimal numbers, allowing nondecimal data in gawk, Allowing Nondecimal Input Data
- decimal point character, Locales can influence conversion, Where You Are Makes a Difference
- decrement operators, Increment and Decrement Operators, Operator Precedence (How Operators Nest)
- definitions of functions, Function Definition Syntax
- examples, Function Definition Examples
- delarray() user-defined function, Function Definition Examples
- delete command (debugger), Control of Breakpoints
- delete statement, The delete Statement
- delta, Be careful comparing values
- /dev/fd/N file, Accessing Other Open Files with gawk
- /dev/stderr file, Special Files for Standard Preopened Data Streams
- /dev/stdin file, Special Files for Standard Preopened Data Streams
- /dev/stdout file, Special Files for Standard Preopened Data Streams
- /dev/tty file, Special Files for Standard Preopened Data Streams
- DFA regexp matcher (GAWK_NO_DFA variable), Other Environment Variables
- directories
- on the command line, Directories on the Command Line
- reading, gawk extension for, Reading Directories
- search path in gawk, The AWKPATH Environment Variable
- disable command (debugger), Control of Breakpoints
- disable_assigns() user-defined function, Treating Assignments as Filenames
- display command (debugger), Viewing and Changing Data
- dlopen() function (in C), Writing Extensions for gawk
- dlsym() function (in C), Writing Extensions for gawk
- dl_load() function, Boilerplate Code
- dl_load_func macro, Boilerplate Code
- do-while statement, The do-while Statement
- double-precision floating-point numbers, A General Description of Computer Arithmetic
- down command (debugger), Working with the Stack
- do_sort() function, Indirect Function Calls
- dump command (debugger), Miscellaneous Commands
- --dump-variables
option, Command-Line Options
- dupword program, Finding Duplicated Words in a Document
- dynamic regexps, Using Dynamic Regexps
E
- e (enable) command (debugger), Control of Breakpoints
- -e option, Command-Line Options, Command-Line Options
- -E option, Command-Line Options
- avoiding conflicts between your program and gawk’s
options, Processing Command-Line Options
- EBCDIC character set, Translating Between Characters and Numbers, Splitting a Large File into Pieces
- egrep utility, Regular Expression Operators, Using Bracket Expressions, Searching for Regular Expressions in Files–Printing Out User Information
- emalloc() macro, Memory Allocation Functions and Convenience Macros
- empty pattern, Pattern Elements, The Empty Pattern
- empty strings, Shell Quoting Issues
- enable command (debugger), Control of Breakpoints
- end command (debugger), Control of Execution
- END rule, Some Simple Examples, Pattern Elements, The BEGIN and END Special Patterns, Noting Datafile Boundaries
- assertions, exiting, Assertions
- cleanup actions, Startup and cleanup actions
- input/output from, Input/output from BEGIN and END rules, Assertions
- next statement in, The next Statement
- ENDFILE rule, Pattern Elements, The BEGINFILE and ENDFILE Special Patterns
- endfile() user-defined function, Noting Datafile Boundaries, Searching for Regular Expressions in Files, Counting Things
- endgrent() user-defined function, Reading the Group Database
- endpat (see begpat, endpat)
- endpwent() function
- C language, Reading the User Database
- user-defined, Reading the User Database
- enums, General-Purpose Data Types
- ENVIRON variable, The AWKPATH Environment Variable, Built-in Variables That Convey Information
- environment variables (gawk), The Environment Variables gawk Uses
- AWKBUFSIZE, Other Environment Variables
- AWKLIBPATH, The AWKLIBPATH Environment Variable, Loading Dynamic Extensions into Your Program, Integrating the Extensions
- AWKPATH, The AWKPATH Environment Variable, Including Other Files into Your Program, An Easy Way to Use Library Functions
- AWKREADFUNC, Other Environment Variables
- AWK_HASH, Other Environment Variables
- for use by developers, Other Environment Variables
- for use by regular users, Other Environment Variables
- GAWK_MSEC_SLEEP, Other Environment Variables
- GAWK_MSG_SRC, Other Environment Variables
- GAWK_NO_DFA, Other Environment Variables
- GAWK_NO_PP_RUN, Other Environment Variables
- GAWK_READ_TIMEOUT, Other Environment Variables, Reading Input with a Timeout
- GAWK_SOCK_RETRIES, Other Environment Variables
- GAWK_STACKSIZE, Other Environment Variables
- INT_CHAIN_MAX, Other Environment Variables
- POSIXLY_CORRECT, Command-Line Options, Other Environment Variables
- STR_CHAIN_MAX, Other Environment Variables
- TIDYMEM, Other Environment Variables
- equivalence classes, Using Bracket Expressions
- erealloc() macro, Memory Allocation Functions and Convenience Macros
- ERRNO variable, The BEGINFILE and ENDFILE Special Patterns, Built-in Variables That Convey Information
- updating in gawk extension API, Updating ERRNO
- error messages, writing to standard error, Special Files for Standard Preopened Data Streams
- errors (arithmetic), Other Stuff to Know
- escape sequences, Escape Sequences
- for metacharacters, Escape Sequences
- in regular expressions, Summary
- processing of, Escape Sequences
- processing with sub(), gensub(), and gsub()
functions, More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- regular expressions inside strings, Using Dynamic Regexps
- variable values given on command line, processing
for, Other Command-Line Arguments
- eval command (debugger), Viewing and Changing Data
- eval command (shell), An Easy Way to Use Library Functions
- --exec option, Command-Line Options
- executable scripts, Executable awk Programs, Running the Example Programs
- @execute statements, Using getline from a Pipe
- execution, debugger commands controlling, Control of Execution
- exit callback functions, registering in gawk extension
API, Registering an exit callback function
- exit statement, The exit Statement
- in assertions, Assertions
- exit status (gawk), gawk’s Exit Status
- exp() function, Numeric Functions
- Expat XML parser library, The gawkextlib Project
- exponents, Other Stuff to Know
- expressions, Expressions–Summary
- as patterns, Pattern Elements, Expressions as Patterns
- constant, Constant Expressions–Using Regular Expression Constants
- conversion of strings and numbers, Conversion of Strings and Numbers
- locales influencing, Locales can influence conversion
- function calls, Function Calls
- in function parameters, order of evaluation, Calling Built-in Functions
- locales affecting, Where You Are Makes a Difference
- operator precedence, Operator Precedence (How Operators Nest)
- operators in, Operators: Doing Something with Values–Truth Values and Conditions
- assignment, Assignment Expressions
- increment and decrement operators, Increment and Decrement Operators
- truth values and conditions, Truth Values and Conditions–Conditional Expressions
- Boolean expressions, Boolean Expressions
- conditional expressions, Conditional Expressions
- true and false in awk, True and False in awk
- variable typing and comparison expressions, Variable Typing and Comparison Expressions
- variables, Variables
- Extended Regular Expressions (EREs), Using Bracket Expressions
- extensions
- common extensions summary, Common Extensions Summary
- dynamic, loading into your program, Loading Dynamic Extensions into Your Program
- gawk, Writing Extensions for gawk–Summary
- API description, API Description–How gawk Finds Extensions
- API tests, testext extension, API Tests
- communication between gawk and extension, How It Works at a High Level
- dumping and restoring an array, rwarray
extension, Dumping and Restoring an Array
- example, file functions, Example: Some File Functions
- file-related functions, The Sample Extensions in the gawk Distribution
- fnmatch(), interface to, Interface to fnmatch()
- fork(), wait(), and waitpid(), interface to, Interface to fork(), wait(), and waitpid()
- gawkextlib project, The gawkextlib Project
- how gawk finds extensions, How gawk Finds Extensions
- in-place file editing, Enabling In-Place File Editing
- integrating, Integrating the Extensions
- licensing, Extension Licensing
- not in POSIX awk, Extensions in gawk Not in POSIX awk
- ord() and chr(), Character and Numeric values: ord() and chr()
- reading an entire file, readfile extension, Reading an Entire File
- reading directories, Reading Directories
- reversing output, Reversing Output
- time functions, Extension Time Functions
- two-way I/O example, Two-Way I/O Example
- in Brian Kernighan’s awk, Extensions in Brian Kernighan’s awk
- extract program, Extracting Programs from Texinfo Source Files–A Simple Stream Editor
F
- f (formfeed character), Escape Sequences, Multiple-Line Records
- f (frame) command (debugger), Working with the Stack
- -F option, Command-Line Options
- -f option, Command-Line Options
- debugging and, How to Start the Debugger
- used more than once on command line, Command-Line Options
- fatal() extension function, Printing Messages
- fflush() function, Input/Output Functions
- field separators, Specifying How Fields Are Separated
- (see also FS variable)
- space as, Cutting Out Fields and Columns
- summary of, Field-Splitting Summary, Summary
- --field-separator fs
option, Command-Line Options
- fields, Examining Fields
- changing contents, Changing the Contents of a Field
- cutting out, Cutting Out Fields and Columns–Cutting Out Fields and Columns
- defining by content, Defining Fields by Content
- making each character a field, Making Each Character a Separate Field
- making full line a single field, Making the Full Line Be a Single Field
- nonconstant field numbers, Nonconstant Field Numbers
- setting FS variable from command line, Setting FS from the Command Line
- splitting, summary of, Summary
- FIELDWIDTHS variable, Reading Fixed-Width Data, Built-in Variables That Control awk
- using in cut utility, Cutting Out Fields and Columns
- file descriptors, Special Files for Standard Preopened Data Streams
- file functions, gawk extensions, Example: Some File Functions, File-Related Functions
- C code for chdir() and stat(), C Code for chdir() and stat()
- fnmatch(), Interface to fnmatch()
- using chdir() and stat(), Using chdir() and stat()
- --file source-file
option, Command-Line Options
- filename arguments, Other Command-Line Arguments
- FILENAME variable, Built-in Variables That Convey Information, Noting Datafile Boundaries
- filenames
- program files, Running Long Programs
- treating assignments as, Treating Assignments as Filenames
- files
- closing for redirection output, Closing Input and Output Redirections
- in-place editing, gawk extension for, Enabling In-Place File Editing
- reading an entire file at once, Reading a Whole File at Once
- reading an entire file, readfile gawk
extension, Reading an Entire File
- reading records from, using getline, Using getline from a File
- splitting large text files into pieces, Splitting a Large File into Pieces
- finish command (debugger), Control of Execution
- fixed-width data, reading, Reading Fixed-Width Data
- floating-point arithmetic, A General Description of Computer Arithmetic
- caveats, Floating-Point Arithmetic: Caveat Emptor!
- enhancing stability and accuracy, Try a Few Extra Bits of Precision and Rounding
- getting the accuracy you need, Getting the Accuracy You Need
- inexact nature of, Floating-Point Arithmetic Is Not Exact
- accumulation of errors, Errors accumulate
- comparing values, Be careful comparing values
- no exact representation of many numbers, Many numbers cannot be represented exactly
- setting precision, Setting the Precision
- setting rounding mode, Setting the Rounding Mode
- floating-point numbers
- double-precision, Numeric and string constants
- in conversions of strings and numbers, How awk converts between strings and numbers
- precision, A General Description of Computer Arithmetic
- fnmatch() function, Interface to fnmatch()
- FNR variable, Summary, Built-in Variables That Convey Information
- changing, Built-in Variables That Convey Information
- for statement, The for Statement
- break statement in, The break Statement
- continue statement in, The continue Statement
- scanning an array, Scanning All Elements of an Array
- scanning array of arrays, Arrays of Arrays
- scanning multidimensional arrays, Scanning Multidimensional Arrays
- using in id utility, Printing Out User Information
- fork() function, Interface to fork(), wait(), and waitpid()
- format specifiers, Controlling Numeric Output with print, Introduction to the printf Statement
- CONVFMT variable as format specifier with
sprintf(), How awk converts between strings and numbers
- format strings, Introduction to the printf Statement
- strftime() function, Time Functions
- translations and, Rearranging printf Arguments
- format-control letters, Format-Control Letters
- formfeed character (a), Escape Sequences
- formfeed character (f), Multiple-Line Records
- FPAT variable, Defining Fields by Content, Built-in Variables That Control awk
- frame command (debugger), Working with the Stack
- Free Software Foundation (FSF), The GNU Project and This Book
- FS variable, Command-Line Options, Built-in Variables That Control awk
- assigning null string to, Making Each Character a Separate Field
- changes to, not affecting fields, Making the Full Line Be a Single Field
- IGNORECASE variable and, Field-Splitting Summary
- in cut utility, Cutting Out Fields and Columns
- regular expression as value of, Using Regular Expressions to Separate Fields
- setting, Specifying How Fields Are Separated
- setting from command line, Setting FS from the Command Line
- setting to
, Making the Full Line Be a Single Field, Multiple-Line Records
- summary of values, Summary
- fts() function, File-Related Functions
- FUNCTAB variable, Built-in Variables That Convey Information
- function (or func) keyword, Function Definition Syntax
- function libraries, A Library of awk Functions–Summary
- command-line options, processing, Processing Command-Line Options–Processing Command-Line Options
- constructing and including in gawk, Including Other Files into Your Program
- datafile management functions, Datafile Management
- checking for readable datafiles, Checking for Readable Datafiles
- checking for zero-length files, Checking for Zero-Length Files
- noting file boundaries, Noting Datafile Boundaries
- rereading the current file, Rereading the Current File
- treating assignments as filenames, Treating Assignments as Filenames
- easy way to use library functions, An Easy Way to Use Library Functions
- general programming functions, General Programming
- assertions, Assertions
- Cliff random number generator, The Cliff Random Number Generator
- converting strings to numbers, Converting Strings to Numbers
- managing time of day, Managing the Time of Day
- merging an array into a string, Merging an Array into a String
- quoting strings to pass to the shell, Quoting Strings to Pass to the Shell
- reading an entire file at once, Reading a Whole File at Once
- rounding numbers, Rounding Numbers
- translating between characters and numbers, Translating Between Characters and Numbers
- naming global variables, Naming Library Function Global Variables
- reading the group database, Reading the Group Database–Reading the Group Database
- reading the user database, Reading the User Database–Reading the User Database
- traversing arrays of arrays, Traversing Arrays of Arrays–Summary
- function pointers
- C and C++, Indirect Function Calls
- gawk extension API, Introduction, Introduction
- functions, Function Calls, Functions–Summary
- array functions in gawk extension API, Array functions
- built-in, Other Features of awk, Built-in Functions–String-Translation Functions
- bit-manipulation functions, Bit-Manipulation Functions
- calling, Calling Built-in Functions
- getting type information, Getting Type Information
- input/output functions, Input/Output Functions
- numeric functions, Numeric Functions
- string-manipulation functions, String-Manipulation Functions–More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- string-translation functions, String-Translation Functions
- time functions, Time Functions
- C function implementing awk function, naming
of, C Code for chdir() and stat()
- constructor functions, gawk extension API, Constructor Functions
- extension, registering with gawk, How It Works at a High Level
- file-related, gawk extensions, File-Related Functions
- function calls, Function Calls
- gawk extension API, accessing and updating
parameters, Accessing and Updating Parameters
- in gawk extension API boilerplate code, Boilerplate Code
- indirect function calls, Indirect Function Calls–Indirect Function Calls
- next statement in function body, The next Statement
- nextfile statement in function body, The nextfile Statement
- registration functions, gawk extension API, Registration Functions
- user-defined, User-Defined Functions–Functions and Their Effects on Variable Typing
- calling, Calling User-Defined Functions
- effects on variable typing, Functions and Their Effects on Variable Typing
- function definition syntax, Function Definition Syntax
- return statement, The return Statement
G
- -g option, Command-Line Options
- gawk, Preface
- additional functionlity of, Preface
- advanced features, Advanced Features of gawk–Summary
- array traversal, controlling, Controlling Array Traversal and Array Sorting–Sorting Array Values and Indices with gawk
- array values and indices, sorting, Sorting Array Values and Indices with gawk
- network programming using gawk, Using gawk for Network Programming
- nondecimal input data, Allowing Nondecimal Input Data
- profiling awk programs, Profiling Your awk Programs–Profiling Your awk Programs
- two-way communications with another process, Two-Way Communications with Another Process
- arithmetic and arbitrary-precision arithmetic, Arithmetic and Arbitrary-Precision Arithmetic with gawk–Summary
- array scanning orders, predefined, Using Predefined Array Scanning Orders with gawk
- arrays of arrays, Arrays of Arrays
- AWKPATH variable, simulating searching of, An Easy Way to Use Library Functions
- BEGINFILE and ENDFILE patterns, The BEGINFILE and ENDFILE Special Patterns, Noting Datafile Boundaries
- close() function, Closing Input and Output Redirections
- command-line options, Command-Line Options
- date utility, Time Functions
- debugging awk programs, Debugging awk Programs–Summary
- environment variables, The Environment Variables gawk Uses–Other Environment Variables, Other Environment Variables
- exit status, gawk’s Exit Status
- extensions, Common Extensions Summary
- not in POSIX awk, Extensions in gawk Not in POSIX awk
- history of, History of awk and gawk
- IGNORECASE variable, Case Sensitivity in Matching
- including other files into your program, Including Other Files into Your Program
- indirect function calls, Function Calls, Indirect Function Calls–Indirect Function Calls
- input files, splitting into records, Record Splitting with gawk
- installing, Installing gawk–Reporting Problems and Bugs
- internationalization, Internationalization with gawk–Summary
- interval expressions in regexps, Regular Expression Operators
- loading dynamic extensions, Loading Dynamic Extensions into Your Program
- locales
- decimal point character, Locales can influence conversion
- string processing in bytes, String-Manipulation Functions
- major contributors to, Major Contributors to gawk
- newlines in, awk Statements Versus Lines
- nextfile statement, The nextfile Statement
- numeric constants, octal and hexadecimal, Octal and hexadecimal numbers
- obsolete options and features, Obsolete Options and/or Features
- predefined variables, Built-in Variables That Control awk
- regexp operators, gawk-Specific Regexp Operators
- regexp ranges and locales, Regexp Ranges and Locales: A Long Sad Story
- reporting problems and bugs, Reporting Problems and Bugs
- special filenames in, Special Filenames in gawk
- accessing other open files with /def/fd/N, Accessing Other Open Files with gawk
- caveats, Special Filename Caveats
- files for network communications, Special Files for Network Communications
- standard input, standard output, and standard
error, Special Files for Standard Preopened Data Streams
- strftime() function, Time Functions
- string-manipulation functions, String-Manipulation Functions
- strings, Numeric and string constants
- sub(), gsub(), and gensub() functions, escape
processing, More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- system() function, Input/Output Functions
- writing extensions for, Writing Extensions for gawk–Summary
- gawkapi.h header file, API Description
- gawkextlib project, The gawkextlib Project
- GAWK_MSEC_SLEEP environment variable, Other Environment Variables
- GAWK_MSG_SRC environment variable, Other Environment Variables
- GAWK_NO_DFA environment variable, Other Environment Variables
- GAWK_NO_PP_RUN environment variable, Other Environment Variables
- GAWK_READ_TIMEOUT environment variable, Other Environment Variables, Reading Input with a Timeout
- GAWK_SOCK_RETRIES environment variable, Other Environment Variables
- GAWK_STACKSIZE environment variable, Other Environment Variables
- GDB (GNU Debugger), Debugging awk Programs
- --gen-pot option, Command-Line Options, Translating awk Programs
- gensub() function, How Much Text Matches?, Using Regular Expression Constants
- defined, String-Manipulation Functions
- (backslash) and & (ampersand) in replacement
text, More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- getgrent() user-defined function, Reading the Group Database
- getgrgid() user-defined function, Reading the Group Database
- getgrnam() user-defined function, Reading the Group Database
- getgruser() user-defined function, Reading the Group Database
- getline command, Explicit Input with getline
- closing redirections, Closing Input and Output Redirections
- important points to remember, Points to Remember About getline
- summary of getline variants, Summary of getline Variants
- using from a coprocess, Using getline from a Coprocess
- using from a file, Using getline from a File
- using from a pipe, Using getline from a Pipe
- using into a variable, Using getline into a Variable
- using into a variable from a coprocess, Using getline into a Variable from a Coprocess
- using into a variable from a file, Using getline into a Variable from a File
- using into a variable from a pipe, Using getline into a Variable from a Pipe
- using with no arguments, Using getline with No Arguments
- getline() function, Reading the User Database
- getlocaltime() user-defined function, Managing the Time of Day, An Alarm Clock Program
- getopt() function, Naming Library Function Global Variables
- C language, Processing Command-Line Options
- user-defined, Processing Command-Line Options–Processing Command-Line Options, Cutting Out Fields and Columns
- using in egrep utility, Searching for Regular Expressions in Files
- using in uniq utility, Printing Nonduplicated Lines of Text
- using in wc utility, Counting Things
- getopt_long() function, Processing Command-Line Options
- getpwent() function
- C language, Reading the User Database
- user-defined, Reading the User Database
- getpwnam() user-defined function, Reading the User Database
- getpwuid() user-defined function, Reading the User Database
- gettext library, GNU gettext
- internationalization of gawk, gawk Can Speak Your Language
- gettimeofday() extension function, Extension Time Functions
- global variables
- access to, in gawk extension API, Symbol Table Access
- naming in library functions, Naming Library Function Global Variables
- printing sorted list of, Command-Line Options
- GNU Autotools, Integrating the Extensions, The gawkextlib Project
- GNU Debugger (GDB), Debugging awk Programs
- GNU General Public License, Extension Licensing, GNU General Public License–GNU General Public License
- GNU implementation of awk (gawk), Preface
- GNU MPFR and GNU MP (GMP) libraries, Arbitrary-Precision Arithmetic Features in gawk, Arbitrary-Precision Integer Arithmetic with gawk
- GNU Project, The GNU Project and This Book
- GNU-style long options, Command-Line Options, Processing Command-Line Options
- grcat program (C language), Reading the Group Database
- possible output of, Reading the Group Database
- group database, reading, Reading the Group Database–Reading the Group Database
- group ID of users, printing out, Printing Out User Information–Printing Out User Information
- _gr_init() user-defined function, Reading the Group Database
- gsub() function, How Much Text Matches?, Using Regular Expression Constants
- defined, String-Manipulation Functions
- (backslash) and & (ampersand) in replacement
text, More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
H
- h (help) command (debugger), Miscellaneous Commands
- -h option, Command-Line Options
- header files, gawk extensions, Introduction
- help command (debugger), Miscellaneous Commands
- --help option, Command-Line Options
- here documents, An Easy Way to Use Library Functions
- hexadecimal escape (x), Escape Sequences, Changes Between SVR3.1 and SVR4
- hexadecimal escape sequences, Escape Sequences
- hexadecimal numbers, Octal and hexadecimal numbers
- in string-to-number conversions, Converting Strings to Numbers
- history file (shell), removing duplicates from, Removing Duplicates from Unsorted Text
- horizontal tab character ( ), Escape Sequences
- HUP signal, Profiling Your awk Programs
I
- i (info) command (debugger), Obtaining Information About the Program and the Debugger
State
- -i option, Command-Line Options, Command-Line Options, Searching for Regular Expressions in Files
- id utility, Printing Out User Information–Printing Out User Information
- IEEE 754 standard
- basic format values, Other Stuff to Know
- rounding modes, Setting the Rounding Mode
- support for, Standards Versus Existing Practice
- if statement
- break statement in, The break Statement
- not operator (!) in, Boolean Expressions
- if-else statement, The if-else Statement
- in tee program, Duplicating Output into Multiple Files
- ignore command (debugger), Control of Breakpoints
- IGNORECASE variable, Case Sensitivity in Matching, Built-in Variables That Control awk, Searching for Regular Expressions in Files
- array subscripting and, Introduction to Arrays
- FPAT variable and, Defining Fields by Content
- FS variable and, Field-Splitting Summary
- simulating use of in non-gawk implementations, A Library of awk Functions
- implementation-specific options, Command-Line Options
- in operator, Operator Precedence (How Operators Nest)
- index in array expression, Referring to an Array Element
- --include option, Command-Line Options
- @include
statements, Command-Line Options, Including Other Files into Your Program
- nested, Using getline into a Variable from a File, An Easy Way to Use Library Functions
- use in constructing self-contained gawk
programs, Including Other Files into Your Program
- including files into your program, Including Other Files into Your Program
- making file inclusion available for standard
awk, An Easy Way to Use Library Functions–Finding Anagrams from a Dictionary
- increment expressions, The for Statement
- increment operators, Points to Remember About getline, Increment and Decrement Operators, Operator Precedence (How Operators Nest), The while Statement, Counting Things
- index() function, Using getline with No Arguments, String-Manipulation Functions
- indices
- array, Introduction to Arrays
- associative arrays, Introduction to Arrays
- determining if element exists at certain index, Referring to an Array Element
- multidimensional arrays, Multidimensional Arrays
- scanning array in numerical order of, Controlling Array Traversal
- sorting before traversing the array, Controlling Array Traversal
- sorting on, using asorti(), Sorting Array Values and Indices with gawk
- string, String-Manipulation Functions
- indirect function calls, Function Calls, Indirect Function Calls–Indirect Function Calls
- sorting arbitrary data in an arbitrary fashion, Indirect Function Calls
- using in processing arrays, Traversing Arrays of Arrays
- infinite loops, The for Statement
- infinity (inf), Other Stuff to Know
- positive and negative infinity, Standards Versus Existing Practice
- info command (debugger), Obtaining Information About the Program and the Debugger
State
- informational variables, gawk extension API, Informational variables
- inplace extension (gawk), Enabling In-Place File Editing
- input files, Reading Input Files–Summary
- defining fields by content, Defining Fields by Content
- directories on the command line, Directories on the Command Line
- explicit input with getline, Explicit Input with getline–Reading Input with a Timeout
- field contents, changing, Changing the Contents of a Field
- field separation, specifying, Specifying How Fields Are Separated–Reading Fixed-Width Data
- fields, Examining Fields
- making each character a separate field, Making Each Character a Separate Field
- multiple-line records, Multiple-Line Records
- nonconstant field numbers, Nonconstant Field Numbers
- reading fixed-width data, Reading Fixed-Width Data
- reading input with a timeout, Reading Input with a Timeout
- splitting into records, How Input Is Split into Records
- with gawk, Record Splitting with gawk
- with standard awk, Record Splitting with Standard awk
- input parsers (custom), gawk extension API, Customized input parsers
- input/output (I/O)
- closing redirections, Closing Input and Output Redirections
- customized output wrappers, gawk extension
API, Customized output wrappers
- customized two-way processors, gawk extension
API, Customized two-way processors
- execution of operation with |& operator, Two-Way Communications with Another Process
- from BEGIN and END rules, Input/output from BEGIN and END rules, Assertions
- functions for, Input/Output Functions
- naming standard input, Naming Standard Input
- redirection operators in print and printf
statements, Operator Precedence (How Operators Nest)
- two-way I/O example, revtwoway gawk extension, Two-Way I/O Example
- INT signal, Profiling Your awk Programs
- int() function, Numeric Functions
- integer arithmetic, A General Description of Computer Arithmetic
- integers, converting to strings, How awk converts between strings and numbers
- integrating gawk extensions, Integrating the Extensions
- internationalization
- and localization, Internationalization and Localization
- string-translation functions, String-Translation Functions
- with gawk, Internationalization and Localization–Summary
- GNU gettext, GNU gettext
- internationalizing awk programs, Internationalizing awk Programs
- simple example, A Simple Internationalization Example–gawk Can Speak Your Language
- translating awk programs, Translating awk Programs–awk Portability Issues
- interpreted languages, Executable awk Programs
- interval expressions, Regular Expression Operators
- interval expressions in regexps, Command-Line Options
- INT_CHAIN_MAX environment variable, Other Environment Variables
- inventory-shipped datafile (for code examples), Datafiles for the Examples
- isarray() function, Getting Type Information, Traversing Arrays of Arrays
- testing if array element is an array, Arrays of Arrays
- ISO 1999 C standard, Standards Versus Existing Practice
L
- l (list) command (debugger), Miscellaneous Commands
- -l option, Command-Line Options, The AWKLIBPATH Environment Variable, Loading Dynamic Extensions into Your Program
- -L option, Command-Line Options
- length() function
- for strings, String-Manipulation Functions
- Libmawk, Other Freely Available awk Implementations
- libraries
- loadable extensions stored as system shared libraries in
gawk, The AWKLIBPATH Environment Variable
- loading shared libraries, Loading Dynamic Extensions into Your Program
- library functions, A Library of awk Functions
- (see also function libraries)
- BEGIN and END rules, multiple, Startup and cleanup actions
- licensing, gawk extensions, Extension Licensing
- lines versus statements, in awk programs, awk Statements Versus Lines
- --lint option, Command-Line Options, Command-Line Options
- LINT variable, Built-in Variables That Control awk
- --lint-old option, Command-Line Options
- lintwarn() extension function, Printing Messages
- list command (debugger), Miscellaneous Commands
- --load option, Command-Line Options
- @load statement, File-Related Functions
- loading dynamic extensions into programs, Loading Dynamic Extensions into Your Program
- loading shared libraries, Integrating the Extensions
- local variables, Naming Library Function Global Variables
- in library functions, Naming Library Function Global Variables
- locale categories, GNU gettext
- locales, Where You Are Makes a Difference
- collating order, string comparisons based
on, String comparison with POSIX rules
- influencing conversions between strings and
numbers, Locales can influence conversion
- regexp ranges and, Regexp Ranges and Locales: A Long Sad Story
- string processing in terms of characters, not
bytes, String-Manipulation Functions
- localization, Internationalization and Localization
- log() function, Numeric Functions
- logical expressions, Boolean Expressions
- (see also Boolean expressions)
- looping statements
- break statement and, The break Statement
- continue statement and, The continue Statement
- do-while, The do-while Statement
- for, The for Statement
- switch statement and, The switch Statement
- while, The while Statement
- lshift() function (gawk), Bit-Manipulation Functions
M
- -M option, Command-Line Options, Arbitrary-Precision Integer Arithmetic with gawk
- macros, gawk extension API, Introduction
- allocating storage from gawk_malloc() and
gawk_realloc(), Memory Allocation Functions and Convenience Macros
- boilerplate code for, Boilerplate Code
- creating string and numeric values, Constructor Functions
- magic() function, Variable access and update by cookie
- mail-list datafile (for code examples), Datafiles for the Examples
- mailing labels, printing, Printing Mailing Labels–Generating Word-Usage Counts
- match() function, How Much Text Matches?
- defined, String-Manipulation Functions
- RLENGTH variable, Built-in Variables That Convey Information
- RSTART variable, Built-in Variables That Convey Information
- side effects of, Function Calls
- matching expressions, regular expressions used in, How to Use Regular Expressions
- mawk, Other Freely Available awk Implementations
- memory allocation functions, gawk extension API, Memory Allocation Functions and Convenience Macros
- memory leaks, finding with TIDYMEM environment
variable, Other Environment Variables
- memory management, gawk extensions, Introduction
- metacharacters
- escape sequences for, Escape Sequences
- summary of, Regular Expression Operators
- minus sign (see - (hyphen), in Symbols section)
- mktime() function, Time Functions
- MMK and MMS, Compiling gawk on VMS
- modifiers (in format specifiers), Modifiers for printf Formats
- MPFR library, Arbitrary-Precision Arithmetic Features in gawk, Arbitrary-Precision Integer Arithmetic with gawk
- msgfmt utility, A Simple Internationalization Example
- MSYS environment, using gawk in, Using gawk in the MSYS environment
- multidimensional arrays, Multidimensional Arrays
- scanning, Scanning Multidimensional Arrays
- mv utility, Redirecting Output of print and printf
N
-
(newline character), Escape Sequences
- in bracket expressions for dynamic regexps, Using Dynamic Regexps
- in printf statements, Introduction to the printf Statement
- printing a string containing embedded newlines, print Statement Examples
- setting FS variable to, Making the Full Line Be a Single Field, Multiple-Line Records
- n (next) command (debugger), Control of Execution
- -n option, Command-Line Options
- -N option, Command-Line Options
- NaN (Not a Number), Other Stuff to Know
- support for, Standards Versus Existing Practice
- nested includes, An Easy Way to Use Library Functions
- networking
- special files in gawk for, Special Files for Network Communications
- using gawk, Using gawk for Network Programming
- newline character (
), Escape Sequences
- newlines
- as end of statements, awk Statements Versus Lines
- as field separator, Examining Fields
- NEWS file (gawk), How to Stay Current
- next command (debugger), Control of Execution
- next statement
- BEGIN and END rules and, Input/output from BEGIN and END rules
- in user-defined functions, Passing function arguments by value or by reference
- nextfile statement, The nextfile Statement
- BEGIN and END rules and, Input/output from BEGIN and END rules
- in BEGINFILE rules, The BEGINFILE and ENDFILE Special Patterns
- in user-defined functions, Passing function arguments by value or by reference
- nexti command (debugger), Control of Execution
- NF variable, Record Splitting with Standard awk, Examining Fields, Summary, Built-in Variables That Convey Information
- in END rules, Input/output from BEGIN and END rules
- ni (nexti) command (debugger), Control of Execution
- --non-decimal-data
option, Command-Line Options, Octal and hexadecimal numbers, Allowing Nondecimal Input Data
- normalized, Other Stuff to Know
- Not a Number (see NaN)
- not operator (!), Boolean Expressions, Operator Precedence (How Operators Nest)
- NR variable, Nonconstant Field Numbers, Summary, Built-in Variables That Convey Information
- changing, Built-in Variables That Convey Information
- NUL character, RS variable set to, Record Splitting with gawk
- null strings, Shell Quoting Issues
- as array subscripts, Using Uninitialized Variables as Subscripts
- matching, String-Manipulation Functions
- numbers
- conversions between strings and numbers, Conversion of Strings and Numbers
- functions converting strings to numbers, Converting Strings to Numbers
- influence of locales, Locales can influence conversion
- creating numeric values in gawk extension API, Constructor Functions
- decimal, octal, and hexadecimal, Octal and hexadecimal numbers
- representation in gawk extension API, General-Purpose Data Types
- rounding, Rounding Numbers
- string type versus numeric type, String type versus numeric type
- strtonum() function, String-Manipulation Functions
- translating between characters and numbers, Translating Between Characters and Numbers
- using to subscript arrays, Using Numbers to Subscript Arrays
- value ranges for different numeric
representations, A General Description of Computer Arithmetic
- numeric attribute, String type versus numeric type
- numeric comparisons, String type versus numeric type
- numeric constants, Constant Expressions
- base not affecting its value, Octal and hexadecimal numbers
- octal and hexadecimal, Octal and hexadecimal numbers
- numeric functions, Numeric Functions
- numeric strings, String type versus numeric type
- num_ge() function, Indirect Function Calls
O
- o (option) command (debugger), Obtaining Information About the Program and the Debugger
State
- -o option, Command-Line Options
- -O option, Command-Line Options
- obsolete options and features, Obsolete Options and/or Features
- octal escape sequences, Escape Sequences
- octal numbers, Octal and hexadecimal numbers
- in string-to-number conversions, Converting Strings to Numbers
- OFMT variable, Controlling Numeric Output with print, How awk converts between strings and numbers, Built-in Variables That Control awk
- OFS variable, Changing the Contents of a Field, Output Separators, Built-in Variables That Control awk
- printf statements and, Introduction to the printf Statement
- one-shot throwaway awk programs, running, One-Shot Throwaway awk Programs
- OpenSolaris POSIX awk, Other Freely Available awk Implementations
- OpenVMS (see VMS)
- operating systems
- gawk on, Preface
- non-Unix, installing gawk on, Installation on Other Operating Systems
- ports of gawk for, people maintaining, Reporting Problems and Bugs
- Unix-like, compiling and installing gawk, Compiling and Installing gawk on Unix-Like Systems–The Configuration Process
- operators, Operators: Doing Something with Values–Truth Values and Conditions
- arithmetic, Arithmetic Operators
- binary, Nonconstant Field Numbers
- bitwise, Bit-Manipulation Functions
- Boolean, Boolean Expressions
- comparison, Comparison operators
- evaluation order, Increment and Decrement Operators
- increment and decrement, Increment and Decrement Operators
- precedence, Regular Expression Operators, Operator Precedence (How Operators Nest)
- regexp, Regular Expression Operators–Regular Expression Operators, Summary
- comparisons, How to Use Regular Expressions
- GNU operators, gawk-Specific Regexp Operators
- string concatenation and, String Concatenation
- --optimize option, Command-Line Options
- option command (debugger), Obtaining Information About the Program and the Debugger
State
- or operator (||), Boolean Expressions, Operator Precedence (How Operators Nest)
- or() function (gawk), Bit-Manipulation Functions
- ord() extension function, Character and Numeric values: ord() and chr()
- ord() function, Translating Between Characters and Numbers, Splitting a Large File into Pieces
- ORS variable, Output Separators, Built-in Variables That Control awk
- printf statements and, Introduction to the printf Statement
- output
- closing input and output redirections, Closing Input and Output Redirections
- duplicating into multiple files, Duplicating Output into Multiple Files
- interactive versus noninteractive
buffering, Input/Output Functions
- printing, Printing Output–Summary
- controlling numeric output with print, Controlling Numeric Output with print
- files for standard pre-opened data streams, Special Files for Standard Preopened Data Streams
- output separators, Output Separators
- print statement, The print Statement
- printf statement, Using printf Statements for Fancier Printing–Redirecting Output of print and printf
- redirecting output of print and printf, Redirecting Output of print and printf
- reversing, revoutput gawk extension, Reversing Output
- output field separator (see OFS variable)
- output format specification (see OFMT variable)
- output record separators (see ORS variable)
- output records, Output Separators
P
- p (print) command (debugger), Viewing and Changing Data
- -p option, Command-Line Options
- -P option, Command-Line Options
- parameter-list (function definitions), Function Definition Syntax
- $PATH shell variable, Executable awk Programs
- patsplit() function, Using Regular Expression Constants
- defined, String-Manipulation Functions
- patterns, Patterns, Actions, and Variables
- BEGIN and END special patterns, The BEGIN and END Special Patterns
- BEGINFILE and ENDFILE special patterns, The BEGINFILE and ENDFILE Special Patterns
- empty pattern, The Empty Pattern
- expressions as, Expressions as Patterns
- omitting, Some Simple Examples
- regular expressions as, Some Simple Examples, Regular Expressions, Regular Expressions as Patterns
- searching for with awk, Getting Started with awk
- specifying record ranges with, Specifying Record Ranges with Patterns
- types of awk patterns, Pattern Elements
- pawk, Other Freely Available awk Implementations
- period (see . (dot), in Symbols section)
- Perl, When to Use awk
- pipe fitting, Duplicating Output into Multiple Files
- pipes
- closing, Closing Input and Output Redirections
- closing one end of a two-way pipe, Closing Input and Output Redirections
- piping command lines into the shell, Redirecting Output of print and printf
- sending print output through, Redirecting Output of print and printf
- two-way, opening to another process with gawk, Two-Way Communications with Another Process
- using getline from, Using getline from a Pipe
- using getline into a variable from a pipe, Using getline into a Variable from a Pipe
- Plauger, P.J., A Library of awk Functions
- plug-ins (see extensions)
- positional specifiers, Modifiers for printf Formats, Rearranging printf Arguments
- use in translated format strings, portability
and, awk Portability Issues
- --posix option, Command-Line Options, gawk-Specific Regexp Operators, Directories on the Command Line
- support for NaN and infinity values, Standards Versus Existing Practice
- POSIX standard
- awk standard (1992), Changes Between SVR4 and POSIX awk
- character classes, Using Bracket Expressions
- command-line options, Command-Line Options
- Extended Regular Expressions (EREs), Using Bracket Expressions
- extensions in gawk not in POSIX awk, Extensions in gawk Not in POSIX awk
- fflush() function, Input/Output Functions
- floating-point numbers and gawk, Standards Versus Existing Practice
- function keyword, Function Definition Syntax
- operating in strict POSIX mode, Command-Line Options
- Shell (sh) command language, An Easy Way to Use Library Functions
- string comparisons, String comparison with POSIX rules
- sub() and gsub() functions, escape
processing, More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- user information, obtaining, Reading the User Database
- POSIXLY_CORRECT environment variable, Command-Line Options, Other Environment Variables
- post-decrement operator, Increment and Decrement Operators
- post-increment operator, Increment and Decrement Operators
- .pot files, Translating awk Programs
- pre-decrement operator, Increment and Decrement Operators
- pre-increment operator, Increment and Decrement Operators
- .prec (precision) modifier, Modifiers for printf Formats
- PREC variable, Built-in Variables That Control awk
- predefined precision strings, Setting the Precision
- values of, Getting the Accuracy You Need
- precedence (operator), Regular Expression Operators, Operator Precedence (How Operators Nest)
- arithmetic operators, Arithmetic Operators
- precision
- defined, Other Stuff to Know
- IEEE 754 binary formats, Other Stuff to Know
- setting for arithmetic operations, Setting the Precision
- --pretty-print
option, Command-Line Options, Other Environment Variables, Profiling Your awk Programs
- print command (debugger), Viewing and Changing Data
- print statement, The print Statement
- closing output redirections for, Closing Input and Output Redirections
- comma between items, print Statement Examples
- controlling numeric output, Controlling Numeric Output with print
- examples of, print Statement Examples
- in BEGIN and END rules, Input/output from BEGIN and END rules
- in histsort.awk program, Removing Duplicates from Unsorted Text
- OFMT variable, Built-in Variables That Control awk
- output separators, Output Separators
- redirecting output, Redirecting Output of print and printf
- redirecting output to standard data streams, Special Files for Standard Preopened Data Streams
- redirection operators, Operator Precedence (How Operators Nest)
- treating data as numeric, Allowing Nondecimal Input Data
- printf command (debugger), Viewing and Changing Data
- printf statement, Using printf Statements for Fancier Printing–Redirecting Output of print and printf
- closing output redirections for, Closing Input and Output Redirections
- format-control letters, Format-Control Letters
- modifiers for formats, Modifiers for printf Formats
- redirecting output, Redirecting Output of print and printf
- redirection operators, Operator Precedence (How Operators Nest)
- rounding numbers, Rounding Numbers, Setting the Rounding Mode
- translations, Rearranging printf Arguments
- using to make an aligned table (example), Examples Using printf
- printing
- --pretty-print option in gawk, Profiling Your awk Programs
- format strings for printf and sprintf, translations
and, Rearranging printf Arguments
- myprint() user-defined function, defining, Function Definition Examples
- nonduplicated lines of text, Printing Nonduplicated Lines of Text–Printing Nonduplicated Lines of Text
- p command, gawk debugger, Finding the Bug
- program to print mailing labels, Printing Mailing Labels–Generating Word-Usage Counts
- use of positional specifiers in printf or sprintf,
portability issues, awk Portability Issues
- user information, printing out, Printing Out User Information–Printing Out User Information
- warning messages from gawk extensions, Printing Messages
- private variables, Naming Library Function Global Variables
- procedural langauges, Getting Started with awk
- process-related special files, deprecated in gawk, Obsolete Options and/or Features
- PROCINFO variable, Built-in Variables That Convey Information
- gawk extensions changing, Variable access and update by name
- group ID numbers, Reading the Group Database
- MPFR and GMP libraries, information on, Arbitrary-Precision Arithmetic Features in gawk
- READ_TIMEOUT, Reading Input with a Timeout
- sorted_in values, Using Predefined Array Scanning Orders with gawk, Controlling Array Traversal
- using to control order of array traversal, Controlling Array Traversal
- user’s user and group ID numbers, access to, Reading the User Database
- --profile option, Profiling Your awk Programs
- profiling
- -p command-line option, Command-Line Options
- using gawk to profile awk programs, Profiling Your awk Programs–Profiling Your awk Programs
- program files, Running Long Programs
- pr_first_field() function, Printing Out User Information
- pseudo-ttys (ptys), using for two-way communication, Two-Way Communications with Another Process
- pwcat program (C language), Reading the User Database
- using in awk user-defined functions, Reading the User Database
- _pw_init() user-defined function, Reading the User Database
- Python, When to Use awk
- Python module (pawk), Other Freely Available awk Implementations
Q
- q (quit) command (debugger), Miscellaneous Commands
- QSE awk, Other Freely Available awk Implementations
- QTawk, Other Freely Available awk Implementations
- quicksort() user-defined function, Indirect Function Calls
- quit command (debugger), Miscellaneous Commands
- QUIT signal, Profiling Your awk Programs
- quotation marks (see ‘ (quotation marks single) and “ (quotation marks, double),
in Symbols section)
- quoting
- in MS-Windows batch files, Quoting in MS-Windows batch files
- of strings to pass to the shell, Quoting Strings to Pass to the Shell
- shell issues with, Shell Quoting Issues
- using shell quoting for variable substitution, Using Shell Variables in Programs
R
-
(carriage return character), Escape Sequences
- r (run) command (debugger), Control of Execution
- -r option, Command-Line Options
- randint() user-defined function, Numeric Functions
- random numbers
- Cliff random number generator, The Cliff Random Number Generator
- rand() function, Numeric Functions
- randint() user-defined function, Numeric Functions
- range expressions, Using Bracket Expressions
- ranges
- in regular expressions, Regexp Ranges and Locales: A Long Sad Story
- range patterns, Expressions as Patterns, Specifying Record Ranges with Patterns
- --re-interval
option, Command-Line Options, gawk-Specific Regexp Operators
- reada() function, Dumping and Restoring an Array
- readdir extension, Reading Directories
- readfile gawk extension, Reading an Entire File
- readfile() user-defined function, Reading a Whole File at Once
- readline library, command completion and history expansion
features, Readline Support
- READ_TIMEOUT, Reading Input with a Timeout
- record separators, Record Splitting with Standard awk
- records, Reading Input Files
- multiple-line, Multiple-Line Records
- output, Output Separators
- printing, Record Splitting with Standard awk
- ranges of, specifying with patterns, Pattern Elements, Specifying Record Ranges with Patterns
- splitting input into, How Input Is Split into Records–Examining Fields
- splitting, locales and, Where You Are Makes a Difference
- redirections, Redirecting Output of print and printf
- closing input and output redirections, Closing Input and Output Redirections
- operator precedence, Operator Precedence (How Operators Nest)
- output done with > operator, Extracting Programs from Texinfo Source Files
- reference-counted strings (gawk), Creating and using cached values
- regexp constants, How to Use Regular Expressions, Summary, Regular expression constants, Regular Expressions as Patterns
- as an expression, Comparison operators
- confusion with
- = operator, Assignment Expressions
- string constants versus, Using Dynamic Regexps
- using, Using Regular Expression Constants
- register_ext_version() extension function, Registering an extension version string
- registration functions, gawk extension API, Registration Functions
- regular expressions, Some Simple Examples, Regular Expressions–Summary, Summary
- as patterns, Pattern Elements
- case sensitivity in matching, Case Sensitivity in Matching
- comparisons, string comparisons versus, Comparison operators
- determining how much text matches, How Much Text Matches?
- escape sequences, Escape Sequences
- GAWK_NO_DFA variable, Other Environment Variables
- in gensub() function, String-Manipulation Functions
- in match() function, String-Manipulation Functions, String-Manipulation Functions
- in patsplit() function, String-Manipulation Functions
- in sub() function, String-Manipulation Functions
- operators, Regular Expression Operators–Regular Expression Operators
- GNU operators, gawk-Specific Regexp Operators
- precedence of, Regular Expression Operators
- ranges within, and interactions with locales, Regexp Ranges and Locales: A Long Sad Story
- RS variable, value of, Record Splitting with gawk
- searching for in files, Searching for Regular Expressions in Files–Printing Out User Information
- usage, How to Use Regular Expressions
- using bracket expressions, Using Bracket Expressions
- using dynamic regexps, Using Dynamic Regexps
- using to separate fields, Using Regular Expressions to Separate Fields
- using with FPAT variable, Defining Fields by Content
- relational operators, Comparison operators
- (see also comparison operators)
- remainder, computing, Arithmetic Operators
- return character (
), Escape Sequences
- return command (debugger), Control of Execution
- return statement in user-defined functions, The return Statement
- return value, Function Calls
- revoutput gawk extension, Reversing Output
- revtwoway gawk extension, Two-Way I/O Example
- rewind() user-defined function, Rereading the Current File
- RLENGTH variable, Built-in Variables That Convey Information, String-Manipulation Functions
- rounding mode, Other Stuff to Know
- setting, Setting the Rounding Mode
- rounding numbers, library function for, Rounding Numbers
- ROUNDMODE variable, Built-in Variables That Control awk, Setting the Rounding Mode
- RS variable, Record Splitting with Standard awk, Built-in Variables That Control awk
- changing value on command line, Record Splitting with Standard awk
- gawk, Record Splitting with gawk
- set to an empty string, Multiple-Line Records
- setting for readfile() function, Reading a Whole File at Once
- setting to , not portable, Record Splitting with gawk
- summary of how records are split with, Multiple-Line Records
- summary of values, Summary
- rshift() function (gawk), Bit-Manipulation Functions
- rsort() function, Indirect Function Calls
- RSTART variable, Built-in Variables That Convey Information, String-Manipulation Functions
- RT variable, Record Splitting with gawk, Multiple-Line Records, Built-in Variables That Convey Information
- Ruby, When to Use awk
- rules, Getting Started with awk, Actions
- BEGIN and END, The BEGIN and END Special Patterns
- multiple rules on a line, separting with
semicolon, awk Statements Versus Lines
- patterns and, Pattern Elements
- run command (debugger), Control of Execution
- rwarray gawk extension, Dumping and Restoring an Array
S
- s (step) command (debugger), Control of Execution
- s operator, gawk-Specific Regexp Operators
- S operator, gawk-Specific Regexp Operators
- -S option, Command-Line Options
- --sandbox option, Command-Line Options
- save command (debugger), Obtaining Information About the Program and the Debugger
State
- scalar cookies, General-Purpose Data Types
- working with, Variable access and update by cookie
- scalar values, General-Purpose Data Types
- scope (variable), controlling, Controlling variable scope
- scripting languages, When to Use awk
- search and replacement for strings, String-Manipulation Functions
- search path, The AWKPATH Environment Variable
- sed (simple stream editor), A Simple Stream Editor–A Simple Stream Editor
- seed (random number), Numeric Functions
- set command (debugger), Viewing and Changing Data
- set_charlist() function, Cutting Out Fields and Columns
- set_fieldlist() function, Cutting Out Fields and Columns
- shells, One-Shot Throwaway awk Programs
- backslash continuation, awk Statements Versus Lines
- here documents, An Easy Way to Use Library Functions
- history file, removing duplicates from, Removing Duplicates from Unsorted Text
- Korn shell (ksh), |& operator, Two-Way Communications with Another Process
- piping command lines into, Redirecting Output of print and printf
- POSIX Shell (sh) command language, An Easy Way to Use Library Functions
- quoting rules, Shell Quoting Issues
- quoting strings to pass to, Quoting Strings to Pass to the Shell
- redirection of standard input and output
streams, Special Files for Standard Preopened Data Streams
- setting POSIXLY_CORRECT in startup file, Command-Line Options
- use of shell variables in awk programs, Using Shell Variables in Programs
- shell_quote() user-defined function, Quoting Strings to Pass to the Shell
- short circuit operators, Boolean Expressions
- si (stepi) command (debugger), Control of Execution
- side effects
- of functions, Function Calls
- operator evaluation order and, Increment and Decrement Operators
- significand, Other Stuff to Know
- silent command (debugger), Control of Execution
- sin() function, Numeric Functions
- single-precision floating-point numbers, A General Description of Computer Arithmetic
- sleep utility, An Alarm Clock Program
- sleep() extension function, Extension Time Functions
- Software Tools (Kernighan and Plauger), A Library of awk Functions
- sort utility
- ensuring traditional Unix (ASCII) sorting, Two-Way Communications with Another Process
- using as part of a coprocess, Two-Way Communications with Another Process
- sort() function, Indirect Function Calls
- sorting
- array values and indices with gawk, Sorting Array Values and Indices with gawk
- controlling array traversal with, in gawk, Controlling Array Traversal
- in word frequency count program, Generating Word-Usage Counts
- quicksort() user-defined function, Indirect Function Calls
- sorted array traversal, Using Predefined Array Scanning Orders with gawk
- source command (debugger), Obtaining Information About the Program and the Debugger
State
- source file (-f option), Command-Line Options
- source files
- external, including, Including Other Files into Your Program
- Texinfo, extracting programs from, Extracting Programs from Texinfo Source Files–A Simple Stream Editor
- --source option, Command-Line Options
- space modifier (printf and sprintf), Modifiers for printf Formats
- sparse arrays, Introduction to Arrays
- split program, Splitting a Large File into Pieces
- split() function, Using Regular Expression Constants
- clearing out an array, The delete Statement
- defined, String-Manipulation Functions
- using in extract program, Extracting Programs from Texinfo Source Files
- using in uniq program, Printing Nonduplicated Lines of Text
- sprintf() function, Controlling Numeric Output with print, Built-in Variables That Control awk
- CONVFMT as format specifier, How awk converts between strings and numbers
- defined, String-Manipulation Functions
- positional specifiers, use in translated format
strings, awk Portability Issues
- rounding numbers, Rounding Numbers
- sqrt() function, Numeric Functions
- srand() function, Numeric Functions
- stability (numerical), Other Stuff to Know
- stack frames, Debugging Concepts, Finding the Bug
- stack, GAWK_STACKSIZE variable, Other Environment Variables
- standard error output, Special Files for Standard Preopened Data Streams
- standard input, Explicit Input with getline, Special Files for Standard Preopened Data Streams
- naming, Naming Standard Input
- standard output, Special Files for Standard Preopened Data Streams
- outputfile initialized to, in uniq utility, Printing Nonduplicated Lines of Text
- stat() function, Using chdir() and stat()
- C code for, C Code for chdir() and stat()
- in gawk filefuncs extension, File-Related Functions
- state machines, Printing Nonduplicated Lines of Text
- statements, Actions
- Boolean expressions in, Boolean Expressions
- control statements in actions, Control Statements in Actions
- break, The break Statement
- continue, The continue Statement
- do-while, The do-while Statement
- exit, The exit Statement
- for, The for Statement
- if-else, The if-else Statement
- next, The next Statement
- nextfile, The nextfile Statement
- switch, The switch Statement
- while statement, The while Statement
- in body-of-function, Function Definition Syntax
- multiple, on a line, separating with semicollon, awk Statements Versus Lines
- types supported in awk, Actions
- versus lines in awk programs, awk Statements Versus Lines
- step command (debugger), Control of Execution
- stepi command (debugger), Control of Execution
- stream editor (see sed)
- strftime() function, Time Functions, Managing the Time of Day
- string attribute, String type versus numeric type
- string comparisons, String type versus numeric type, Comparison operators
- using POSIX rules, String comparison with POSIX rules
- string concatenation, String Concatenation, Operator Precedence (How Operators Nest)
- string constants
- defined, Numeric and string constants
- regexp constants versus, Using Dynamic Regexps
- string-manipulation functions, String-Manipulation Functions–More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- (backslash) and & (ampersand) with sub(),
gensub(), and gsub() functions, More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- string-translation functions, String-Translation Functions
- strings, Numeric and string constants
- C-style strings in most awk implementations, Record Splitting with gawk
- conversions between strings and numbers, Conversion of Strings and Numbers
- functions converting strings to numbers, Converting Strings to Numbers
- creating string values in gawk extension API, Constructor Functions
- defined, Some Simple Examples
- in gawk extension API, General-Purpose Data Types
- merging arrays into, Merging an Array into a String
- null (or empty), Shell Quoting Issues
- quoting strings to pass to the shell, Quoting Strings to Pass to the Shell
- string type versus numeric type, String type versus numeric type
- strnum attribute, String type versus numeric type
- strtod() function, Standards Versus Existing Practice
- strtonum() function, String-Manipulation Functions, Allowing Nondecimal Input Data
- structs, defined by gawk extension API, Introduction
- STR_CHAIN_MAX environment variable, Other Environment Variables
- sub() function, How Much Text Matches?, Using Regular Expression Constants
- defined, String-Manipulation Functions
- (backslash) and & (ampersand) with, More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- subarrays, Arrays of Arrays, Controlling Array Traversal
- order in sorted array traversal, Using Predefined Array Scanning Orders with gawk
- sorting order for, Controlling Array Traversal
- using as an argument to a function, Arrays of Arrays
- subscripts in arrays, Comparison operators
- arrays of arrays, Arrays of Arrays
- using numbers, Using Numbers to Subscript Arrays
- using uninitialized variables, Using Uninitialized Variables as Subscripts
- SUBSEP variable, Built-in Variables That Control awk, Multidimensional Arrays, Merging an Array into a String
- using with join() function in extract program, Extracting Programs from Texinfo Source Files
- substitutions
- sub(), gsub(), and gensub() functions, (backslash)
and & (ampersand) in replacement text, More about ‘’ and ‘&’ with sub(), gsub(), and
gensub()
- substr() function, Using getline with No Arguments, String-Manipulation Functions, Processing Command-Line Options
- using in uniq utility, Printing Nonduplicated Lines of Text
- sudo utility, The gawkextlib Project
- switch statement, The switch Statement
- symbol table access, gawk extension API, Symbol Table Access
- creating and using cached values, Creating and using cached values
- variable access and update by cookie, Variable access and update by cookie
- variable access and update by name, Variable access and update by name
- SYMTAB variable, Built-in Variables That Convey Information
- System V Release 3.1 (SVR 3.1), Major Changes Between V7 and SVR3.1
- System V Release 4 (SVR4), Changes Between SVR3.1 and SVR4
- system() function, Input/Output Functions, An Alarm Clock Program
- systime() function, Time Functions
T
- (horizontal tab character), Escape Sequences
- t command (debugger), Control of Breakpoints
- -t option, Command-Line Options
- tab character ( ), Escape Sequences
- tbreak command (debugger), Control of Breakpoints
- TCP/IP networking, gawk and, Using gawk for Network Programming
- tee program, Duplicating Output into Multiple Files
- temporary files, using to communicate with another
process, Two-Way Communications with Another Process
- terminal, Special Files for Standard Preopened Data Streams
- testext gawk extension, API Tests
- Texinfo source files, extracting programs from, Extracting Programs from Texinfo Source Files–A Simple Stream Editor
- text domain, GNU gettext
- text matching and substitutions, How Much Text Matches?
- TEXTDOMAIN variable, Built-in Variables That Control awk, String-Translation Functions, Internationalizing awk Programs
- setting, Internationalizing awk Programs
- thousands separator in numbers, Locales can influence conversion
- TIDYMEM environment variable, Other Environment Variables
- time (see dates and time)
- time() system call, Time Functions
- timeout, setting for reading input, Reading Input with a Timeout
- tolerance, Be careful comparing values
- tolower() function, Case Sensitivity in Matching, String-Manipulation Functions, Transliterating Characters
- toupper() function, Case Sensitivity in Matching, String-Manipulation Functions, Transliterating Characters
- tr utility, Transliterating Characters–Transliterating Characters
- trace command (debugger), Miscellaneous Commands
- --traditional option, Command-Line Options, Command-Line Options, gawk-Specific Regexp Operators, Directories on the Command Line
- translating awk programs, Translating awk Programs–awk Portability Issues
- awk portability issues, awk Portability Issues
- extracting marked strings, Extracting Marked Strings
- rearranging printf arguments, Rearranging printf Arguments
- true and false in awk, True and False in awk
- ! operator and, Boolean Expressions
- comparison expressions, value of, Comparison operators
- trunc-mod operation, Arithmetic Operators
- two-way I/O, gawk revtwoway extension, Two-Way I/O Example
- two-way processors (I/O), gawk extension API, Customized two-way processors
- types
- array data types, gawk extension API, Array data types
- functions getting type information, Getting Type Information
- functions’ effects on variable typing, Functions and Their Effects on Variable Typing
- general-purpose data types, gawk extension
API, General-Purpose Data Types
- variable typing in awk, Variable Typing and Comparison Expressions
U
- u (until) command (debugger), Control of Execution
- unbiased rounding, Rounding Numbers
- undisplay command (debugger), Viewing and Changing Data
- unexpected_eof() user-defined function, Extracting Programs from Texinfo Source Files
- Unicode, Translating Between Characters and Numbers
- unions, General-Purpose Data Types
- uniq utility, Printing Nonduplicated Lines of Text–Printing Nonduplicated Lines of Text
- debugging, How to Start the Debugger
- Unix awk, Other Freely Available awk Implementations
- Unix-based systems
- commands, basic, Preface
- Unix-like systems, compiling and installing gawk on, Compiling and Installing gawk on Unix-Like Systems–The Configuration Process
- unsorted data, removing duplicates from, Removing Duplicates from Unsorted Text
- until command (debugger), Control of Execution
- unwatch command (debugger), Viewing and Changing Data
- up command (debugger), Working with the Stack
- usage() function, The switch Statement, Cutting Out Fields and Columns, Searching for Regular Expressions in Files
- --use-lc-numeric
option, Command-Line Options, Locales can influence conversion
- user information
- obtaining, Reading the User Database–Reading the User Database
- printing out, Printing Out User Information–Printing Out User Information
- user-defined functions, Function Calls, User-Defined Functions–Functions and Their Effects on Variable Typing
- calling, Calling User-Defined Functions
- controlling variable scope, Controlling variable scope
- passing arguments by value or by reference, Passing function arguments by value or by reference
- controlling array sorting, Sorting Array Values and Indices with gawk
- effects on variable typing, Functions and Their Effects on Variable Typing
- function definition syntax, Function Definition Syntax
- regexp constants as arguments to, Using Regular Expression Constants
- return statement, The return Statement
- USR1 signal, sending to gawk, Profiling Your awk Programs
- UTC (Coordinated Universal Time), Time Functions
V
- v (vertical tab character), Escape Sequences, Changes Between SVR3.1 and SVR4
- -v option, Command-Line Options, Other Command-Line Arguments
- -V option, Command-Line Options
- values
- in gawk extension API, General-Purpose Data Types
- requesting in gawk extension API, Requesting Values
- variable-assignment arguments, Other Command-Line Arguments
- variables, Variables
- -v command-line option, Command-Line Options
- accessing and updating in gawk extension
API
- by cookie, Variable access and update by cookie
- by name, Variable access and update by name
- assignment on command line, Other Command-Line Arguments, Assigning variables on the command line
- built-in, Other Features of awk
- from a file, using getline into, Using getline into a Variable from a File
- gawk extension API, API Variables
- in boilerplate code, Boilerplate Code
- information variables, Informational variables
- local to a function, Controlling variable scope
- local variables in function parameter-list, Function Definition Syntax
- local variables in library functions, Naming Library Function Global Variables
- naming global variables in library functions, Naming Library Function Global Variables
- predefined, Predefined Variables
- ARGC and ARGV, using, Using ARGC and ARGV
- controlling awk, Built-in Variables That Control awk
- conveying information, Built-in Variables That Convey Information
- shell variables, using in awk programs, Using Shell Variables in Programs
- typing in awk, Variable Typing and Comparison Expressions
- typing, functions and their effects on, Functions and Their Effects on Variable Typing
- uninitialized, using as array subscripts, Using Uninitialized Variables as Subscripts
- using getline to read next record from awk input into
var, Using getline into a Variable
- using in a program, Using variables in a program
- viewing and changing in gawk, debugger commands
for, Viewing and Changing Data
- --version option, Command-Line Options
- versions
- gawk extension API version constants, API version constants and variables
- registering extension version string in
gawk, Registering an extension version string
- vertical tab character (v), Escape Sequences, Changes Between SVR3.1 and SVR4
- VMS
- compiling gawk on, Compiling gawk on VMS
- installing gawk on, Installing gawk on VMS
- running gawk on, Running gawk on VMS
W
- w (watch) command (debugger), Viewing and Changing Data
- w operator, gawk-Specific Regexp Operators
- W operator, gawk-Specific Regexp Operators
- -W option, Command-Line Options
- wait() function, Interface to fork(), wait(), and waitpid()
- waitpid() function, Interface to fork(), wait(), and waitpid()
- walk_array() user-defined function, Traversing Arrays of Arrays
- warning() extension function, Printing Messages
- watch command (debugger), Viewing and Changing Data
- watchpoints, Debugging Concepts
- setting up, Control of Breakpoints
- wc (word count) utility, Counting Things–A Grab Bag of awk Programs
- Weinberger, Peter J., History of awk and gawk
- where command (debugger), Working with the Stack
- while statement, The while Statement
- for statement and, The for Statement
- not (!) operator in, Boolean Expressions
- whitespace
- leading and trailing, stripping when printing
records, Using Regular Expressions to Separate Fields
- separating fields, Examining Fields
- width modifier, Modifiers for printf Formats
- Windows systems
- installing gawk, Installation on PC Operating Systems
- quoting in batch files, Quoting in MS-Windows batch files
- testing gawk on, Using gawk on PC operating systems
- using gawk in Cygwin environment, Using gawk in the Cygwin environment
- using gawk in MSYS environment, Using gawk in the MSYS environment
- --with-gawk option
(gawkextlib), The gawkextlib Project
- word count (wc) utility, Counting Things–A Grab Bag of awk Programs
- words
- duplicated, finding in a document, Finding Duplicated Words in a Document
- generating word-usage counts, Generating Word-Usage Counts–Generating Word-Usage Counts
- writea() function, Dumping and Restoring an Array
..................Content has been hidden....................
You can't read the all page of ebook, please click
here login for view all page.