Paul Tibbitts - Linux and Unix Shell Programming
Korn and Bash Shell Programming
Preface
Welcome and Introduction
Specific Course Objectives
Your Questions
Typestyle Conventions
Shell Basics
Review of Shell Basics
Why Write Shell Scripts?
Why NOT Write Shell Scripts?
Alternate Unix Scripting Languages
Which Shell for You?
Why use
ksh93
or
bash?
Identifying a Shell
Setting Your Login Shell
Command Line Scripting
What is Command Line Scripting?
Review of Command Line Editing
Review of Startup Files
FNG Regular Expressions
Writing Script Files
Shell Script Structure
Comments
Explicit Execution
Implicit Execution
Executing a Script in the Current Shell
Using
print
Variables
Variables
Setting and Using Variables
Using
typeset
Declaring Integers
Read-only Variables
Text Formatting
Variable Scope
Command Line Arguments
Using
shift
Resetting Command Line Arguments
Useful Built-in Variables
Conditional Execution
Exit Codes
The
test
command
The
let
Command
The
if
Statement
Variations on
if
Command Grouping
The Logical AND -
&&
The Logical OR -
||
The
case
Statement
Substitution and Quoting
Variable Substitution
Default/Alternate Values
Default/Alternate Values (continued)
Substring Operators
Substring Operators in
ksh93
and
bash
Math Substitution
Command Substitution
Process Substitution
Using
expr
Quoting and the Shell
Quoting and Unset Variables
Using
eval
Input/Output
The
print
Command Revisited
The
printf
Command
Redirection Recap
Advanced Redirection
Using
here
Documents
The
read
Command
The
IFS
Variable
Looping
The
while
Loop
The
until
Loop
The
for
Loop
Loop Flow Control
Prompting with
select
Loops and Redirection
Using
getopts
Functions
Why Use Functions
Defining Functions
Passing Parameters
Return Values
Summary of Local Function Variables
Building a Function Library
Signals and Error Handling
Printing Useful Error Messages
Trapping Signals
Using the EXIT Signal
Debugging
Using the DEBUG Signal
Using the ERR Signal
Advanced Features
Arrays
More on Arrays
Background Scripts
Using
nohup
Co-processes
Back to Training Home