UNIX and Linux

Preferred method of contact?

Shell Programming



Course Number



3 Days

View Schedule

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


  • 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

Course Schedule

Attend this live, instructor-led course In-Class or Online via AnyWare.

Hassle-Free Enrollment: No advance payment required.
Tuition due 30 days after your course.

Jun 7 - 9 Ottawa/AnyWare Enroll Now

How would you like to attend?

Live, Online via AnyWare

Jul 19 - 21 Herndon, VA/AnyWare Enroll Now

How would you like to attend?

Live, Online via AnyWare

Aug 16 - 18 AnyWare Enroll Now

How would you like to attend?

Live, Online via AnyWare

Aug 30 - Sep 1 New York/AnyWare Enroll Now

How would you like to attend?

Live, Online via AnyWare

Oct 11 - 13 Ottawa/AnyWare Enroll Now

How would you like to attend?

Live, Online via AnyWare

Dec 13 - 15 AnyWare Enroll Now

How would you like to attend?

Live, Online via AnyWare

Guaranteed to Run

Bring this Course to Your Organization and Train Your Entire Team
For more information, call 1-888-843-8733 or click here






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 course exam on the last day of your course and receive a Certificate of Achievement with the designation "Awarded with Distinction."



Call 1-888-843-8733 or click here »

An experienced training advisor will happily answer any questions you may have and alert you to any tuition savings to
which you or your organization may be entitled.

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

FREE Online Course Exam (if applicable) – Last Day: 3:30 pm – 4:30 pm
By successfully completing your FREE online course exam, you will:

  • Have a record of your growth and learning results.
  • Bring proof of your progress back to your organization
  • Earn credits toward industry certifications (if applicable)
  • Make progress toward one or more Learning Tree Specialist & Expert Certifications (if applicable)

Enhance Your Credentials with Professional Certification

Learning Tree's comprehensive training and exam preparation guarantees that you will gain the knowledge and confidence to achieve professional certification and advance your career.

Earn 17 Credits from NASBA

This course qualifies for 17 CPE credits from the National Association of State Boards of Accountancy CPE program. Read more ...

“My course provided me with the critical skills I need, and my performance improved immediately upon returning to work.”

- K. McPartlin, Communications Analyst
The Credit Network


Please Choose a Language

Canada - English

Canada - Français