Call Us at: +1616-469-0394 | Email:

Follow Us on: facebook_icon twitter-icon linkdein_icon




Shell Scripting

System Admin Online Training

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
Back to Top…