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 Korn Shell Programming introductory course.
Development of this course is ongoing and the content and duration are subject to change.
Advanced I/O Redirection
Using file descriptors other than 0, 1, and 2
Closing a file descriptor when I/O is complete
Capturing stderr from commands in a pipe
Using I/O redirection with remote commands (such as with ssh
)
Command and variable substitution
Old-style (obsolete) syntax
New-style syntax
Single and double quotes: When to use each type
Data types for variables using typeset
Performance aspects
Functional aspects
When to use printf
for formatting
Suggestions for integrating typed variables with read
Arrays
What is an array?
Syntax for creating and accessing arrays
When should arrays be used?
Limits in various implementations
Associative arrays (string instead of numeric subscripts)
Shell functions: Basics
Definition: What is a shell function?
Defining shell functions
Using functions in scripts
Building reusable libraries
Shell functions: Advanced
What are autoload functions?
How to use PATH, FPATH, and typeset -f
When is FPATH is searched?
Recent changes in the shell regarding autoloaded functions
Using eval
Examples of the need for eval
Issues related to quoting
Suggestions for how to avoid complicated cases
Program flow control
Review of if
, while
, for
, and case
The until
loop
Details of using select
for interactive menus
Compound variables
What is a compound variable?
The shell's built-in compound variables
User-defined compound variables: why?
Coprocesses
What is a coprocess?
When are coprocesses useful?
Debugging programs
Using the shell's -e
, -x
, and -v
options
Using the ERR and DEBUG signals with the trap
command
Can you use kshdb
?
Performance evaluation and tuning
Why performance matters in shell scripts
Development of a general timing harness
Upon completion of this course, the student will be able to write and debug advanced Korn Shell scripts using the following features and more:
Opening files for read, write, and read/write from within the shell,
Using all 20 forms of parameter substitution for precise control of expressions,
Using associative arrays to increase performance in lookup-intensive scripts,
How to produce formatted output layouts,
Define and use shell functions to better modularize shell scripts,
Create coprocesses as a rudimentary form of parallel processing.
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.
Extensive use of UNIX commands and shell scripting. The student should be thoroughly familiar with directories, file permissions, and using the system editor (such as vi
). There is no review of basic features of the shell as covered in the Korn Shell Programming introductory course, so students must be moderately well-versed in shell scripting.