search for books and compare prices
Tables of Contents for Unix Awk and Sed Programmer's Interactive Workbook
Chapter/Section Title
Page #
Page Count
Foreword
xiii
2
Introduction
xv
4
About the Author
xix
 
CHAPTER 1 Regular Expressions and Metacharacters
1
26
LAB 1.1 Using the period and backslash metacharacters
2
20
1.1.1 Identify the Operands and Operators of a Regular Expression
11
1
1.1.2 Understand the Results of a Regular Expression Consisting of Operands and Operators
12
1
1.1.3 Identify When a Regular Expression Is Evaluated
13
1
1.1.4 Understand the Results of Evaluating the Expression as a Pattern
14
1
1.1.5 Understand the Wildcard Character
15
7
CHAPTER 1 Test Your Thinking
22
5
CHAPTER 2 Character Class, Hyphen, and Caret Metacharacters
27
24
LAB 2.1 The Character Class, Hyphen, and Caret Metacharacters
28
20
2.1.1 Understand the Results of the Character Class, Hyphen, and Caret Metacharacters
33
3
2.1.2 Recognize the Special Rules Regarding the Three Metacharacters
36
1
2.1.3 Write Regular Expressions Using the Three Metacharacters
37
11
CHAPTER 2 Test Your Thinking
48
3
CHAPTER 3 What Is Grep and What Does It Do?
51
16
LAB 3.1 Getting Started with Grep
52
11
3.1.1 Understand How Grep Is Invoked, and the Results of Invoking Grep
56
2
3.1.2 Write Simple Grep Invocations
58
5
CHAPTER 3 Test Your Thinking
63
4
CHAPTER 4 Using Grep with Regular Expressions
67
26
LAB 4.1 Regular Expressions and Grep
68
11
4.1.1 Understand the Results of Using Grep with Regular Expressions
72
2
4.1.2 Understand How to Write Regular Expressions with Grep
74
5
LAB 4.2 fgrep and egrep
79
6
4.2.1 Understand When to Use Grep, Egrep, and Fgrep and the Results of Using Them
81
4
LAB 4.3 Using the Anchor Metacharacter
85
4
4.3.1 Understand How the Anchor Metacharacter Is Used with Grep
86
3
CHAPTER 4 Test Your Thinking
89
4
CHAPTER 5 Introduction to sed
93
16
LAB 5.1 Getting Started with sed
94
13
5.1.1 Understand Simple Substitutions
98
1
5.1.2 The Sed Pattern Space
99
8
CHAPTER 5 Test Your Thinking
107
2
CHAPTER 6 Sed Syntax and Addressing
109
26
LAB 6.1 Sed Syntax and Addressing
110
23
6.1.1 Specify Addresses by Using No Address
117
1
6.1.2 Specify Addresses by Using One Address
117
2
6.1.3 Specify Addresses by Using Two Addresses
119
1
6.1.4 Understand Grouping Commands
120
13
CHAPTER 6 Test Your Thinking
133
2
CHAPTER 7 Sed Commands
135
78
LAB 7.1 The Substitution Command
136
21
7.1.1 Understand the Options to the Substitute Command
144
1
7.1.2 Understand the Replacement String Characters to the Substitute Command
145
12
LAB 7.2 The Delete Command
157
7
7.2.1 Understand the Delete Command
159
5
LAB 7.3 The Append, Insert, and Change Commands
164
16
7.3.1 Understand the Append and Insert Commands
170
2
7.3.2 Understand the Change Command
172
8
LAB 7.4 The List and Transform Commands
180
10
7.4.1 Understand the List Command
183
1
7.4.2 Understand the Transform Command
184
6
LAB 7.5 The Print and Next Commands
190
11
7.5.1 Understand the Print Command
194
1
7.5.2 Understand the Next Command
195
6
LAB 7.6 The Read and Write Commands
201
11
7.6.1 Understand the Read Command
206
1
7.6.2 Understand the Write Command
207
5
CHAPTER 7 Test Your Thinking
212
1
CHAPTER 8 Multiline Pattern Space Commands
213
32
LAB 8.1 The Multiline Next, Delete, and Print Commands
214
25
8.1.1 Understand the Multiline Next Command
222
1
8.1.2 Understand the Multiline Delete Command
223
2
8.1.3 Understand the Multiline Print Statement
225
14
CHAPTER 8 Test Your Thinking
239
6
CHAPTER 9 An Awk Program
245
28
LAB 9.1 An Example Awk Program
246
10
9.1.1 Understand the Results of a Simple Awk Program
250
1
9.1.3 Write a Simple Awk Program
251
5
LAB 9.2 The Structure of an Awk Program
256
9
9.2.1 Understand the Components of an Awk Program
258
7
LAB 9.3 Invoking an Awk Program
265
6
9.3.1 Understand the Various Ways to Invoke Awk at the Command Line
268
3
CHAPTER 9 Test Your Thinking
271
2
CHAPTER 10 Basic Awk Language Elements
273
58
LAB 10.1 Awk Statements and Expressions
274
8
10.1.1 Identify Statements and Expression Components
278
4
LAB 10.2 Awk Strings
282
12
10.2.1 Understand Strings and Escape Sequences
286
1
10.2.2 Understand String Initialization
287
1
10.2.3 Understand String Concatenation
288
6
LAB 10.3 Awk Numbers
294
9
10.3.1 Understand the Various Representations of Numbers
296
1
10.3.2 Understand How Numbers Are Initialized
297
6
LAB 10.4 Coercion
303
19
10.4.1 Understand When a Coercion Is Performed
308
1
10.4.2 Understand the Result of a Coercion
309
3
10.4.3 Understand Explicit and Implicit Coercions
312
10
LAB 10.5 awk Assignment operator
322
6
10.5.1 Identify Rvalues and Lvalues
324
1
10.5.2 Write a Program Using the Assignment Operator
324
4
CHAPTER 10 Test Your Thinking
328
3
CHAPTER 11 Variables
331
40
LAB 11.1 Field Variables
332
13
11.1.1 Understand How Awk Splits an Input Line into Field Variables
333
1
11.1.2 Access Field Variables
334
1
11.1.3 Assigning Values to Field Variables
335
10
LAB 11.2 User-Defined Variables
345
9
11.2.1 Understand the Rules for Naming Variables
347
1
11.2.2 Assign User-Defined Variables
348
6
LAB 11.3 Built-In Variables
354
15
11.3.1 Work with Built-In Field Variables
355
4
11.3.2 Work with Built-In Record Variables
359
10
CHAPTER 11 Test Your Thinking
369
2
CHAPTER 12 Operators
371
46
LAB 12.1 Arithmetic Operators
372
10
12.1.1 Understand the Results of Using the Arithmetic Operators
374
1
12.1.2 Write Programs Using the Arithmetic Operators
375
7
LAB 12.2 the Assignment Statement
382
18
12.2.1 Understand the Results of Using the Arithmetic, Increment, and Decrement Operators
386
2
12.2.2 Write Programs Using These Operators
388
12
LAB 12.3 Logical and Relational Operators, and Conditional Expressions
400
16
12.3.1 Understand the Results of the Conditional Expression and the Logical and Relational Operators
407
1
12.3.2 Write Programs Using the Logical and Relational Operators, and the Conditional Expression
408
8
CHAPTER 12 Test Your Thinking
416
1
CHAPTER 13 Built-in Functions, Precedence, Associativity, and Machine Limits
417
30
LAB 13.1 Built-In Arithmetic Functions
418
6
13.1.1 Understand the Results of Using Built-In Arithmetic Functions
420
1
13.1.2 Write Programs Using Built-In Arithmetic Functions
420
4
LAB 13.2 Built-In String Functions
424
13
13.2.1 Understand the Results of Using Built-In String Functions
429
1
13.2.2 Write Programs Using Built-In String Functions
430
7
LAB 13.3 Patterns, Precedence, Associativity, and Machine Limits
437
8
13.3.1 Understand the Results of Precedence and Associativity
441
1
13.3.2 Understand Machine Limits
441
4
CHAPTER 13 Test Your Thinking
445
2
CHAPTER 14 Awk Control Flow
447
46
LAB 14.1 The If-Else Statement
448
13
14.1.1 Understand the Syntax of an If-Else Statement
451
2
14.1.2 Write Programs Using the If-Else Statement
453
8
LAB 14.2 The While and Do Statements
461
11
14.2.1 Understand the Results of Using a While Statement
465
1
14.2.2 Write Programs Using While and Do Statements
466
6
LAB 14.3 The For Statement
472
8
14.3.1 Understand the Results of Using the For Statement
474
2
14.3.2 Write Programs Using the For Statement
476
4
LAB 14.4 Loop and Program Control
480
9
14.4.1 Understand the Results of Executing a Break, Continue, Next, or Exit Statement
484
1
14.4.2 Write Programs Using These Statement
485
4
CHAPTER 14 Test Your Thinking
489
4
CHAPTER 15 Awk Arrays and Functions
493
52
LAB 15.1 Awk Arrays
494
22
15.1.1 Understand the Results of Using Awk Arrays
502
1
15.1.2 Write Programs Using Awk Arrays
503
13
LAB 15.2 Awk User-Defined Functions
516
26
15.2.1 Understand the Results of Awk User-Defined Functions
524
1
15.2.2 Write Programs Using User-Defined Functions
525
17
CHAPTER 15 Test Your Thinking
542
3
CHAPTER 16 Advanced Input and Output
545
32
LAB 16.1 The printf and sprintf statements
546
16
16.1.1 Understand the Results of Using the Printf and Sprintf Statements
550
2
16.1.2 Write Programs Using These Statements
552
10
LAB 16.2 Output into Pipes, Files, and the Getline Function
562
12
16.2.1 Understand the Results of Using the Getline Function, and Direct Output into Pipes and Files
566
2
16.2.2 Write Programs, Using the Getline Function, That Direct Output into Pipes or Files
568
6
CHAPTER 16 Test Your Thinking
574
3
APPENDIX A Answers to Self-Review Questions
577
12
APPENDIX B Awk, Sed, and Grep Reference
589
28
INDEX
617