Individuals requiring a mastery of the command line interface to the UNIX operating system. This includes system administrators, programmers, and power users. This course is a follow-on to the Bash Shell Programming introductory course.
Development of this course is ongoing and the content and duration are subject to change.
Bash Shell Basics
IO Redirection
Using Pipes
Wildcards for Filenames
Command Substitution
Variable Substitution
Single and Double Quotes
Examples of Quoting
Command Parsing Order
Special Shell Scripts
Things You Should Already Know
Advanced IO Redirection
File Descriptors Beyond 0, 1, and 2
Simultaneously Reading from Multiple Sources
Closing a File Descriptor
Capturing stderr or Exit Code from a Pipe Command
Special Filenames Recognized with IO Redirection
Process Substitution
Using IO Redirection with Builtin Shell Commands
Command Substitution
The Old Way: ``
The New Way: $()
Using Quotes with Command Substitution
Data Types
The declare
Command (a.k.a. typeset
)
When to Use declare
Version-dependent Features
Indexed Arrays
What are Indexed Arrays?
Static Creation
Dynamic Creation
Shell Functions
What is a Shell Function?
Options for Defining Functions
Function Invocation
Examples of Using Functions
Building Reusable Function Libraries
Examples of Function Libraries
Associative Arrays
What are Associative Arrays?
Static Creation
Dynamic Creation
Examples of Using Associative Arrays
Performance Characteristics
Advanced Shell Functions
What is Function Autoloading?
Configuration Options
IO Redirection in a Function Definition
The eval
Command
What is eval
?
Examples of What eval
Can Do
Examples of How Complicated eval
Can Become!
Techniques for Avoiding Complicated Cases
Debugging Scripts
Available Debugging Tools
Using Shell Options for Debugging
Discipline Functions
Background Information for the ERR
Trap
Background Information for the DEBUG
Trap
Using the logger
Command
Common Debugging Approaches
What is bashdb
?
Other Useful Shell Variables
Examples and Wrapup
Examples (from student requests)
Processing Log Files
Processing XML Files
Processing INI Files
Finishing Up
Closing Words
Upon completion of this course, the student will be able to write and debug advanced Bash Shell scripts using the following features and more:
Open files for read, write, and read/write, from within the shell,
Use all forms of parameter expansion for precise control of expressions,
Use associative arrays to increase performance in lookup-intensive scripts,
Produce formatted output layouts,
Define and use shell functions to better modularize shell scripts, and
Create coprocesses as a rudimentary form of parallel processing.
This course does not cover the interactive features of the Bash shell.
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.
Familiarity with UNIX commands and shell scripting. There is no review of basic features of the shell as covered in the Bash Shell Programming scripting course, so students should be moderately well-versed in simple shell scripting, including the creation of scripts from scratch, and thoroughly familiar with directories, file permissions, and using the system editor (such as vi
).
Programming skills should be fairly well-developed before taking this course; students without experience will likely find the pace to be too fast.