O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

sed and awk Pocket Reference, 2nd Edition

Book Description

For people who create and modify text files, sed and awk are power tools for editing. sed, awk, and regular expressions allow programmers and system administrators to automate editing tasks that need to be performed on one or more files, to simplify the task of performing the same edits on multiple files, and to write conversion programs.The sed & awk Pocket Reference is a companion volume to sed & awk, Second Edition, Unix in a Nutshell, Third Edition, and Effective awk Programming, Third Edition. This new edition has expanded coverage of gawk (GNU awk), and includes sections on:

  • An overview of sed and awk?s command line syntax
  • Alphabetical summaries of commands, including nawk and gawk
  • Profiling with pgawk
  • Coprocesses and sockets with gawk
  • Internationalization with gawk
  • A listing of resources for sed and awk users
This small book is a handy reference guide to the information presented in the larger volumes. It presents a concise summary of regular expressions and pattern matching, and summaries of sed and awk.Arnold Robbins, an Atlanta native now happily living in Israel, is a professional programmer and technical author and coauthor of various O'Reilly Unix titles. He has been working with Unix systems since 1980, and currently maintains gawk and its documentation.

Table of Contents

  1. 1. sed & awk Pocket Reference
    1. 1.1. Introduction
    2. 1.2. Conventions Used in This Book
    3. 1.3. Matching Text
      1. 1.3.1. Filenames Versus Patterns
      2. 1.3.2. Metacharacters
        1. 1.3.2.1. Search patterns
        2. 1.3.2.2. Replacement patterns
      3. 1.3.3. Metacharacters, Listed by Unix Program
      4. 1.3.4. Examples of Searching
        1. 1.3.4.1. Examples of searching and replacing
    4. 1.4. The sed Editor
      1. 1.4.1. Command-Line Syntax
      2. 1.4.2. Syntax of sed Commands
        1. 1.4.2.1. Pattern addressing
        2. 1.4.2.2. Examples
      3. 1.4.3. Group Summary of sed Commands
        1. 1.4.3.1. Basic editing
        2. 1.4.3.2. Line information
        3. 1.4.3.3. Input/output processing
        4. 1.4.3.4. Yanking and putting
        5. 1.4.3.5. Branching commands
        6. 1.4.3.6. Multiline input processing
      4. 1.4.4. Alphabetical Summary of sed Commands
    5. 1.5. The awk Programming Language
      1. 1.5.1. Command-Line Syntax
      2. 1.5.2. Important gawk Options
      3. 1.5.3. Profiling with pgawk
      4. 1.5.4. Patterns and Procedures
        1. 1.5.4.1. Patterns
        2. 1.5.4.2. Procedures
        3. 1.5.4.3. Simple pattern-procedure examples
      5. 1.5.5. Built-in Variables
      6. 1.5.6. Operators
      7. 1.5.7. Variable and Array Assignment
        1. 1.5.7.1. Escape sequences
      8. 1.5.8. Octal and Hexadecimal Constants in gawk
      9. 1.5.9. User -Defined Functions
      10. 1.5.10. Group Listing of awk Functions and Commands
      11. 1.5.11. Coprocesses and Sockets with gawk
      12. 1.5.12. Implementation Limits
      13. 1.5.13. Alphabetical Summary of awk Functions and Commands
        1. 1.5.13.1. Output redirections
        2. 1.5.13.2. printf formats
      14. 1.5.14. Internationalization with gawk
    6. 1.6. Additional Resources
      1. 1.6.1. Source Code
      2. 1.6.2. Books
  2. About the Author
  3. Copyright