Course Category: Linux & UnixDuration: 5 DaysAudience: Individuals requiring a mastery of the command line interface to the Linux operating system. This course combines aspects of the Advanced Bash Shell Programming course with practical applications for common Linux users including system administrators, programmers, and power users.
Duration: 5 days
Audience
Individuals requiring a mastery of the command line interface to the Linux operating system. This course combines aspects of the Advanced Bash Shell Programming course with practical applications for common Linux users including system administrators, programmers, and power users.
Course Contents
Click each numbered item to see details. A printed document always shows all details but not this text or the following buttons. Expand All Collapse All
Concepts
What is Unix?
What is Linux?
Open Source vs. Free Software vs. Public Domain
Linux Components
A Historical Overview
Linux Features
Linux Programming Support
Review of the Bash Shell
Linux Components
I/O Redirection
Using Pipes
Wildcards For Filenames
Command Substitution
Variable Substitution
Quoting To Prevent Interpretation
Command Parsing Order
Introducing Shell Scripts
Special Shell Scripts
Interactive Bash
Automatic Configuration
Command History
Command Prompt Customization
Command Line Editing
Set Options
Aliases (Command Macros)
Environment Variables
Example Startup Scripts
Extended Regular Expressions
Review of Regular Expressions
Simple metacharacters
Advanced metacharacters
Extended metacharacters
The grep Command
The egrep Command
Introduction to sed
Applying Commands in a Script
Regular Expressions in sed
A Global Perspective on Addressing
Testing and Saving Output
Four Types of sed Scripts
Getting to the Promised Land
Basic sed Commands
Substitution
Delete
Append, Insert, and Change
List
Transform
Print
Next
Reading and Writing Files
Quit
Advanced sed
Multiline Pattern Space
Please Hold the Line!
Advanced Flow Control Commands
To Join a Phrase
Introduction to awk
Overview
History of awk, nawk, and gawk
Getting Started with awk
Regular Expressions in awk
Reading Input Files
Printing Output
Expressions
Patterns, Actions, and Variables
Advanced awk
Arrays in awk
Functions
Internationalization
Advanced Features
Library of General Use awk Scripts
Data Tools, Part III (*)
The gzip and bzip2 Commands
The tar Command
Common Monitoring Commands
The netstat Command
The vmstat Command
The top Command
The ps Command
The strace and ltrace Commands
The Source: /proc
Bash Scripts: Background
Why Shell Programming?
Steps to Creating a Script
Menu Building — Example Using select
Comments in Shell Scripts
Using Single-Value Variables
Working With Arrays
Parameter Expansion Modifiers
How to Correctly Display Error Messages
Performing Arithmetic (let and (( )))
expr For String Matching
Interactive Scripts (the read Command)
Bash Scripts: Flow Control
The if Command
Test Operations: test, [ ], and [[ ]]
The while Loop
The for Loop
Changing the Script Parameters (set)
Loop Control (break and continue)
The case Command
Exiting a Shell Script
Menu Building — Complete Example
Using at and crontab
Overview of at and crontab
The at Command
Using crontab
Sample Crontab File
Summary
Bash Scripts: User Interaction
Using getopts For Handling Command Line Options
The trap Command
Setting Runtime Options in the Bash Shell
Bash Scripts: Efficiency
Subshells and IO Redirection: ( ), { }, and exec
Conditional Execution (&& and ||)
Temporary Files With mktemp
Floating Point Arithmetic
HERE Documents and HERE Strings
Shell Functions
Advanced Bash Features
In-Depth Shell Functions
Autoload Functions via FPATH
Using eval
Advanced I/O Redirection Using exec
Process Expansion: <(list) and (list)
Coprocesses (New in Bash 4.0+)
Using the bind Command for Keystroke Handling
Performance Evaluation and Tuning
(*)
Prerequisite chapters are in the Bash Shell Programming course.
Course Objectives
Upon completion of this course, the student will be able to write Bash Shell scripts using the following features and more:
I/O redirection, pipes, and command and variable substitution,
Passing parameters to shell scripts and interpreting their meaning,
Controlling the program flow using conditionals and loops,
Catch and interpret Control-C and other asynchronous events, and
Apply debugging techniques to quickly locate coding errors.
Shell scripting is equal parts of running commands and processing the results generated by those commands. This course covers the most important of the text processing commands that are frequently used in efficient shell scripts, and combines that with the built-in control functions of the shell to make them fast and effective. Each chapter includes discussion of when to use each feature, so that students gain an understanding of what works best in a particular situation. Best practices are described throughout the course.
Instructional Technique
Students are invited to bring their current ideas and questions to the classroom for discussion. Case studies, lecture, group problem solving, and online laboratories will be used. Students will be encouraged to enhance their skills utilizing the techniques presented through classroom problem solving and controlled online workshops.
Prerequisites
Completion of an Introduction to Unix or similar course, and six months of command line experience on a Unix/Unix-like operating system. See below for a quick quiz to determine if you’re ready for this fast-paced course.
Programming skills are not required, but are helpful.