![]() |
UNIX Pattern Tools
| Duration: 3 days |
| Participants: Technical users, applications programmers, and systems programmers. |
|
Objectives:
Upon successful completion of this course you will be able to:
- Use the stream editor sed as a filter within a UNIX shell pipeline. - Describe and use special regular expression characters in sed addresses and substitutes. - Specify the features of and uses for awk. - List the components of an awk program. - Define and code awk patterns and actions. - Use awk built-in functions. - Use awk arrays and associative memory. - Code and execute a complete awk program which reads an input file and produces a simple report. - Interface awk with other UNIX tools to perform data validation, extraction, and reporting functions. |
| Overview: This course presents the basic concepts and operation of UNIX commands which use pattern matching and regular expressions. Included in the course are explanations of the stream editor (sed), as well as the pattern scanning and processing language (awk). The course provides an understanding of how to use these powerful pattern matching tools for information retrieval, data manipulation, and report generation. |
| Prerequisites: Introduction to UNIX and Shell Programming courses or equivalent experience. |
| Format: Lecture and discussion with lab sessions. |
|
Topic Outline:
- Stream Editor SED What is SED? Commands General Syntax Specific Commands Substitute Command CUT Command Regular Expressions - awk Introduction awk Features Records and Fields Input Files Command Line Patterns and Actions Comments Simple Print Statement - Simple Actions and Patterns User Defined Variables/Constants Special Variables Operators Numeric Alternative Relational and Logical Regular Expression Operators Metacharacters Patterns Ranges Special Pattern BEGIN Special Pattern END Changing Field Separators - Complex Actions Formatted Printing with printf Format Specification Output Format Control Operator Review Binary Assignment Unary Concatenation Variables and Fields Flow of Control Statements if while for break continue - Built-In Functions Function Format String Functions length index substr sprintf Mathematical Functions - Arrays and Shell Arrays and Array Use for Statement and Arrays Associative Memory Current FILENAME split Function Additional Statements next getline exit NULL Record Separator Output Redirection Pipes and Pipelines Filters Internal Pipes Command Line Parameters Interaction with Shell - awk Conclusions Advantages Disadvantages Where awk fits |
|
|