UNIX® KORN SHELL PROGRAMMING
This course provides an understanding of the command and programming language capabilities of the UNIX System V standard Korn Shell from a programming perspective. It also explains commands particularly useful in conjunction with Shell programs, as well as all of the programming constructs available within the both the Bourne and Korn Shells.
Upon successful completion of this course, the student will be able to:
· Describe the purpose and functions of the Shell Interpreter.
· Use UNIX System commands useful for Shell programming.
· Create and execute Shell programs.
· Use additional forms of input and output redirection in conjunction with Shell programs.
· Establish and use parameters and variables within Shell programs.
· Describe and use special Shell variables.
· Use the Shell quoting mechanisms to escape the meaning of special characters.
· Use all of the Shell control structures.
· Trace, debug, and document Shell programs.
UNIX users who require a general knowledge of Shell Programming.
Introduction to UNIX course or equivalent experience, and experience in programming in any high level programming language.
Three (3) days. Class consists of classroom lecture and lab sessions.
I. INTRODUCTION TO THE SHELL
A. What is the Shell Interpreter?
B. Functions of the Shell Interpreter
C. What is a Shell Procedure?
D. Creating Shell Programs
E. Implicit and Explicit Execution
II. COMMAND LINES & IF CONSTRUCT
A. Useful Shell Commands
B. Command Lines
3. Conditional Operators
C. The if Construct
D. The if-else Construct
E. The if-elif Construct
III. PARAMETERS & VARIABLES
A. What is a Variable?
B. Assigning to Variables
C. The read Statement
1. Special Characters
3. Single Quoting
4. Double Quoting
E. The while Loop
F. Special Variables
G. export and readonly
H. Positional Parameters
IV. TEST & CASE STATEMENTS
A. test Statement Features
1. File Status
2. String Comparison
3. Numeric Comparison
B. The case Statement
V. INPUT/OUTPUT CONSIDERATIONS
A. Command Substitution
B. Redirection of Errors Messages
C. The Here Document
D. The for Loop
VI. DEBUGGING & DOCUMENTING
A. Keyword Parameters
B. Tracing Shell Procedures
C. Handling External Events
D. Comments as Documentation