Korn Shell Programming
Revision: TE2902_20060318
(6.34 KB) View, Download, or Print Catalog as a PDF.
Course Length:
4 Days
Course Description:
This course describes the Korn Shell. The shell as a programming language is featured. The course also thoroughly treats other shell functions such as the shell as the user interface, the shell as a customization tool for the user environment, and the shell as a front end for command customization. Labs are given throughout the course to reinforce the lectures.
Who Should Attend:
The course is intended for UNIX users who wish to increase their productivity.
Benefits of Attendance:
Upon completion of this course, students will be able to:
- Understand process creation.
- Recognize and use shell metacharacters.
- Recall commands for automatic execution (Korn and C Shell).
- Launch and control jobs (Korn and C Shell).
- Provide front ends to well known commands.
- Create and use shell environment variables.
- Customize your environment using many shell productivity aids.
- Write non-trivial shell scripts.
- Write shell functions (Korn and Bourne).
Prerequisites:
Students must have completed the Introduction to UNIX, Introduction to Solaris, or Introduction to LINUX course or have equivalent knowledge.
Course Outline:
- Chapter 1: Shell Initialization
- User Interfaces
- Functions of the Shell
- History of the Shell
- Which Shell Am I Using?
- How is My Shell Started?
- Shell Startup Files
- Korn Shell Logic
- Spawning Processes
- Background Processing
- The kill and jobs command
- Suspending Jobs
- Chapter 2: Shell Variables
- Standard Files
- Korn Shell Variables
- The typeset Command
- Arrays
- Built-in Shell Variables
- Creating Your Own Variables
- Special Shell Variables
- More on Arrays
- Variable Expansions
- Variable Substitutions
- Quoting
- File Name Generation Character
- Chapter 3: Productivity Aids
- Command Line Editing
- Aliases
- The history Command
- Functions
- The set Command
- The User Environment
- Chapter 4: Programming The Shell
- Perspective
- Creating a Script
- Sending Arguments to a Script
- Front Ends
- Decision Making
- The if Statement
- Operators
- if Variations
- Loops
- The for Loop
- The while Loop
- The until Loop
- The read Statement
- The case Statement
- break and continue
- Chapter 5: Miscellaneous
- Korn Shell Arithmetic
- here Documents
- The getopts Command
- The trap Command
- File I/O
- Debugging a Script
- Chapter 6: Examples Of Scripts
- A Front End Example
- Swapping Two Files
- Count Files in Path Directories
- Frequency Count of Words in a
- File
- Add Values From Field n of a
- File
- Prototyping a Large Project
- Chapter 7: Tables
- Built-in Shell Variables
- Built-in Shell Commands
- Control Flow Constructs
- Operators
- Variable Substitution
- Other Shells
- Comparison with C and
- Bourne Shells
- C Shell Control Flow Constructs
- Differences Between sh & ksh
- Chapter 8: Review Of Common Unix Filters
- grep Command - Find Lines Matching a Pattern
- wc command - Count Words, Lines
- sort command - Sort Lines of a File
- head Command - Show First Few Lines of a File
- tail command - Show Last Few Lines of a File
- tr command - Translate Characters
- cut command - Cut chars or Fields
- od - Octal Dump a File
- paste Command - Paste Lines
- awk command - Data Retrieval Language
- sed Command - Stream Editor



