|
內容簡介: |
在处理文本文件方面,awk语言是处理数据提取、报告和数据格式变*的理想工具。《高校awk编程 影印版第4版英文版》既是POSIX标准awk与GNU实现即gawk的参考,也是教材。本书为从初学者到 awk专家级别的广泛用户提供有用参考。
在这本仔细修订的*新版中,作为作者罗宾斯同时也是gawk的主要开发人员,Arnold Robbins详细讲解了awk语言以及gawk程序,演示了如何使用awk和 gawk解决实际问题,并深入gawk的功能细节。系统管理员、程序员、网管以及其他深度用户会找到他们需要知道的关于awl和gawk的一切。
本书遵循GNU Free Documentation License出版,读者可以自由复制和修改这本GNU手册的内容。从本书销售中获得的版税将被分给自由软件基金会和作者本人。
|
目錄:
|
Foreword to the Third Edition
Foreword to the Fourth Edition
Preface
Part Ⅰ. The awk Language
1. Getting Started with awk
How to Run awk Programs
One-Shot Throwaway awk Programs
Running awk Without Input Files
Running Long Programs
Executable awk Programs
Comments in awk Programs
Shell Quoting Issues
Datafiles for the Examples
Some Simple Examples
An Example with Two Rules
A More Complex Example
awk Statements Versus Lines
Other Features of awk
When to Use awk
Summary
2. Running awk and gawk
Invoking awk
Command-Line Options
Other Command-Line Arguments
Naming Standard Input
The Environment Variables gawk Uses
The AWKPATH Environment Variable
The AWKLIBPATH Environment Variable
Other Environment Variables
gawks Exit Status
Including Other Files into Your Program
Loading Dynamic Extensions into Your Program
Obsolete Options andor Features
Undocumented Options and Features
Summary
3. Regular Expressions
How to Use Regular Expressions
Escape Sequences
Regular Expression Operators
Using Bracket Expressions
How Much Text Matches?
Using Dynamic Regexps
gawk-Specific Regexp Operators
Case Sensitivity in Matching
Summary
4. Reading Input Files
How Input Is Split into Records
Record Splitting with Standard awk
Record Splitting with gawk
Examining Fields
Nonconstant Field Numbers
Changing the Contents of a Field
Specifying How Fields Are Separated
Whitespace Normally Separates Fields
Using Regular Expressions to Separate Fields
Making Each Character a Separate Field
Setting FS from the Command Line
Making the Full Line Be a Single Field
Field-Splitting Summary
Reading Fixed-Width Data
Defining Fields by Content
Multiple-Line Records
Explicit Input with getline
Using getline with No Arguments
Using getline into a Variable
Using getline from a File
5. Printing Output
6. Expressions
7. Patterns, Actions, and Variables
8. Arrays in awk
9. Functions
Part Ⅱ. Problem Solving with awk
1O. A Library of awk Functions
11. Practical awk Programs
Part Ⅲ. Moving Beyond Standard awkwith gawk
12. Advanced Features of gawk
13. Internationalization with gawk
14. Debugging awk Programs
15. Arithmetic and Arbitrary-Precision Arithmetic with gawk
16. Writing Extensions for gawk
Part Ⅳ. Appendices
A. The Evolution of the awk Language
B. Installing gawk
C. GNU General Public License
Index
|
|