Preferred method of contact:

Shell Programming



Course Number



3 Days

PDF Add to WishList

Customize your working environment for supercharged productivity with KornShell (ksh) and BASH shell (bash) — powerful command-interpreting languages for Linux, UNIX, and Mac OS. In this Shell programming training course, you gain the skills to write reusable, robust shell scripts, extend your user environment, and automate complex administrative tasks.

You Will Learn How To

  • Write Bash and KornShell scripts for improved productivity
  • Integrate arrays, functions, pattern matching, I/O, branches, loops, and variables
  • Improve speed with multifile handling and string manipulations
  • Create and reuse function libraries

Important Course Information

  • Recommended Experience

    • User-level UNIX commands
    • Simple file editing with basic text, or GUI-based, editor
    • X Window System and basic UNIX networking
  • Software

    • This course uses Red Hat Enterprise Linux
    • Concepts taught are applicable to all Linux distributions

Course Outline

  • Introduction and Overview
  • Benefits of KornShell and Bash vs. other shells
  • Differences between bash, ksh88 and ksh93
  • Integrating scripts with external command-line tools
  • Bash and KornShell Scripting Fundamentals

Shell script elements

  • Commands and comments
  • Defining exit values

Conditional program execution

  • Applying if and case statements
  • Simplifying if logic with elif

Program loops and iteration

  • Conditional looping with while and until
  • Listing for loops

Testing files and directories

  • Analyzing attributes
  • Checking file size and contents

Strings and patterns using [[ ]]

  • Comparing strings
  • Verifying the existence of a string
  • Pattern matching and special characters


  • Redirecting standard error
  • set commands for debugging
  • Storing and Accessing Data

Positional parameters

  • Passing and accessing parameters
  • Manipulating parameters as groups

Shell variables

  • Defining environment and local variables
  • Specifying default values and error conditions


  • Creating and indexing arrays
  • Processing array contents with special variables
  • Processing Data

Manipulating strings

  • Extracting substrings
  • Determining string length


  • Arithmetic for and while loops
  • Writing mathematical expressions: (( )), $(( )) and let
  • Modular Programming with Functions

Function basics

  • Functions vs. scripts
  • Parameters and variables

Creating a function library

  • Finding your library with PATH
  • Dot . and source commands
  • Interacting with the Outside World

Manipulating files and redirecting data

  • Scripting file and directory management
  • Unraveling the secrets of exec: opening and closing multiple files

Interacting with running processes

  • Handling errors
  • Processing external events
  • Handling and sending signals: trap and kill

Accessing network servers

  • Connecting to a network server
  • Exchanging data with a network server
  • Creating "Production Quality" Scripts

Ensuring environmental control

  • Checking and modifying environment variables
  • Using getopts to process command-line options

Handling user actions

  • Accepting command-line arguments
  • Employing select to create a menu interface
  • Processing keyboard input
Show complete outline
Show Less

Convenient Ways to Attend This Instructor-Led Course

Hassle-Free Enrolment: No advance payment required to reserve your seat.
Tuition due 30 days after you attend your course.

In the Classroom

Live, Online

Private Team Training

In the Classroom — OR — Live, Online

Tuition — Standard: $2745   Government: $2415

Dec 18 - 20 ( 3 Days)
9:00 AM - 4:30 PM EST
Herndon, VA / Online (AnyWare) Herndon, VA / Online (AnyWare) Reserve Your Seat

Feb 19 - 21 ( 3 Days)
9:00 AM - 4:30 PM EST
New York / Online (AnyWare) New York / Online (AnyWare) Reserve Your Seat

Guaranteed to Run

When you see the "Guaranteed to Run" icon next to a course event, you can rest assured that your course event — date, time, location — will run. Guaranteed.

Private Team Training

Enrolling at least 3 people in this course? Consider bringing this (or any course that can be custom designed) to your preferred location as a private team training.

For details, call 1-888-843-8733 or Click here »

This event has been added to your cart.




In Classroom or





Private Team Training

Contact Us »

Course Tuition Includes:

After-Course Instructor Coaching
When you return to work, you are entitled to schedule a free coaching session with your instructor for help and guidance as you apply your new skills.

After-Course Computing Sandbox
You'll be given remote access to a preconfigured virtual machine for you to redo your hands-on exercises, develop/test new code, and experiment with the same software used in your course.

Free Course Exam
You can take your Learning Tree course exam on the last day of your course or online any time after class.


Training Hours

Standard Course Hours: 9:00 am – 4:30 pm
*Informal discussion with instructor about your projects or areas of special interest: 4:30 pm – 5:30 pm

- ,

Chat Now

Please Choose a Language

Canada - English

Canada - Français