Brode Training and Consulting, LLC

Korn Shell Programming


This 4-day course is intended for people who:

  • Have some UNIX/Linux system administrator duties
  • Want to extend their UNIX/Linux knowledge
  • Would like to learn programming techniques

Approximately 60% of the first day is lecture, as programming principles and procedures are introduced.  About 40% of the second day is lecture and almost all of the third and fourth days are devoted to lab exercises.  There are more exercises than most students can finish but the coursebook contains complete solutions to all exercises. 



BTC can deliver this course at your site, for up to 8 students, for $5600, which includes instructor travel expenses.

You can also purchase the coursebook to be used as "self-paced" training.  We provide the coursebook and a tar file containing files used for lab exercises.  The coursebook contains lots of information (not just bulleted slides) and lots of lab exercises, as well as a Table of Contents and Alphabetic Index.  The cost is $99.  If you would also like up to 5 hours of email and phone support from the author of the course, the cost is $239, which includes the coursebook.

  • A UNIX/Linux Fundamentals course (OR)
  • At least 6 months of hands-on UNIX/Linux experience

Each class can also be customized in content and length. For example, customers sometimes want a 5-day class which covers the basics of UNIX/Linux but also includes some shell programming techniques.  We will work with you to determine what parts of this course and our UNIX/Linux Fundamentals course to combine that will fit in five days. 



   What is Shell Programming?

   Getting Started




   Single Quotes

   Double Quotes

   Back Quotes

  Command Substitution - Alternate Syntax

   Escape Character (\)


   Regular Expressions








   ED/SED Commands


   AWK Overview



   Types of Variables

   Naming of Variables

   Assigning a Value to a Variable

   Using the Value of a Variable

   Built-in Variables

   User-Defined Variables

   Positional Parameters (Variables)

   Special Positional Parameters

   Variables Read From Input

   The READ command

   The SET and EXPORT Commands

   Integer Variables

   The TYPESET Command

   Using LET for Arithmetic Expressions

   Enclosing a Variable Name Within Braces - '{}'


Conditional Statements

   Exit (return) Status

   Determining the Exit Status of a Command

   The IF Statement

   The EXIT Command

   The TEST Command

   The TEST Command - The '[' Syntax

   The TEST Command - Numeric Comparisons

   The TEST Command - File/String Attributes

   The IF-THEN-ELSE Statement

   The Nested IF Statement

   The IF-THEN-ELIF Statement

   The "&&" and "||" Conditional Operators

   Debugging A Shell Program

   The SET Command

   Documenting a Shell Program


The WHILE Loop

   The WHILE Loop

   The BREAK Command

   The SHIFT Command

   The CONTINUE Command

   The TRUE and FALSE Commands


The FOR loop

   The FOR Loop


The CASE Statement

   The CASE Statement

   The SELECT Loop


   The RETURN Command


Miscellaneous Other I/O Topics

   The HERE Document

   The GETOPTS Command

   Traps and Signals

   The TRAP Command

   The TPUT Command


Arrays and String Operators

   Defining an Array

   Accessing Array Values

   Some Other Special Variables

   String Operators 


A Brief Discussion of the AWK Programming Language


Appendix A - Differences between the Korn and Bourne Shells