Home About Courses Schedule Services Webinars Contact Search

Advanced Shell Programming


Duration: 3 Days

Method: Instructor led, Hands-on workshops

Price: $1625.00

Course Code: UI1040


Technical Users, Applications Programmers, and Systems Programmers requiring an in-depth understanding of the Shell.


This course provides experienced users of the UNIX® System Shell with further insights into its effective and efficient use. The student is prepared to design, code, test debug, and execute structured Shell procedures making full use of the basic, as well as the more advanced features of the Shell.


Upon successful completion of this course, the student will be able to:

  • Describe the Shell interpreter and how it makes use of the UNIX system calls to execute a procedure.
  • Describe the order of evaluation of a command line and make use of the evaluation sequence in writing effective Shell procedures.
  • Use the standard Shell predefined variables, as well as user defined positional and keyword parameters.
  • Use all of the input/output redirection capabilities of the Shell including redirection involving file descriptors 0 to 9.
  • Describe and use the Shell invocation options and all of the built-in Shell statements.
  • Write structured, readable, and maintainable Shell procedures that operate in a UNIX like manner and use the standard UNIX facilities.


Shell programming and UNIX tools courses with a working knowledge of UNIX including at least three (3) months experience in using both the basic command and programming language features of the Shell.


  • I.Introduction
    • Variable Review
    • Control Structure Review
    • select Statement
  • II.Shell Functionality
    • Definitions
      • Shell Interpreter
      • Process
    • Process Related System Calls
      • Fork
      • Exec
      • Wait
    • Shell Program vs. Compiled Program Process Invocation
    • Foreground vs. Background Processes
    • Shell Environment Variables
  • III.Command Line Evaluation
    • Order of Evaluation of Command Line
    • Command Grouping
      • Parenthesis ()
      • Braces {}
    • Pipes
      • Exit Status of Pipe
      • Piping To/From Looping Constructs
      • Piping T/From Conditional Statements
    • eval Statements
  • IV.Parameters and Variables
    • Predefined Variables
    • ${*} vs. ${@}
    • Positional Parameters
    • set Statement
    • Keyword Parameters
    • Special Characters
    • Quoting
      • Backslash
      • Single Quotes
      • Double Quotes
    • getopt and getopts Commands
    • Arrays
  • V.File Descriptors And Redirection
    • Definitions
      • File Descriptor
      • File Descriptor Table
      • Redirection
    • Multiple Redirections to Same File
    • File Creation through Redirection
    • Here Documents
    • Redirection Using File Descriptors other than 0, 1, and 2
    • Using exec Statement to Open Files
  • VI.Execution Flags and Built in Statements
    • hell Innovation Flags
      • Restricted Shell (-r)
      • Interactive Shell (-i)
      • Non-Execution Shell (-n)
      • Immediate EXIT Shell (-e)
      • Unset Variable EXIT Shell (-u)
    • Built-in Statements
  • VII.Readability and Maintainability
    • Comments
      • # vs. :
      • Commenting Standards
    • Formatting Conventions
      • Control Structures
      • Here Documents
    • Variable Naming and Formatting Conventions
    • Error Message Conventions
    • EXIT Code Standards
    • Standard Files and Directories
    • Manual Page Creation
  • VIII.Reliability
    • Special Substitutions
      • Expression Substitution (:-)
      • Variable Substitution (:=)
      • Undefined Variable EXIT (:?)
      • Variable Reassignment (:+)
      • Omitting the Colon (:)
    • Shell Debugging Aids
    • Causes for Shell Program Termination
    • Interrupt Processing
      • trap Statement
      • Catching Signals
      • Ignoring Signals
      • Nested Traps
      • Sending Signals
  • IX.Efficiency
    • PATH Organization
    • Full vs. Relative Pathnames
    • Use of Built-in Statements
    • Benchmarking Programs
    • Optimizing Pipes
    • Efficient Use of Control Structures
    • Recursion
    • Shell Functions
      • Syntax
      • Autoloading
      • Recursion
    • Shell vs. 'C'