Verhoef Training, Inc.

P.O.Box 1515, West Caldwell, NJ 07006
Phone:(800)631-0410 Fax:(973)403-3468



BASH Programming




SUMMARY:   Students will learn to read, write, and debug shell scripts, thus increasing productivity by taking full
advantage of the bash shell.

AUDIENCE:   Linux or UNIX users, programmers, and system administrators.

PREREQUISITES:   Fundamentals of UNIX or Fundamentals of Linux

DURATION:   3 Days

COURSE CONTENT:  

  1. UNIX Processes

    • What is a Process?
    • Process Structure
    • The ps Utility
    • Options to the ps Utility
    • Background Commands (&)
    • Killing Background Processes
    • Redirecting the Standard Error

  2. Getting Started

    • What is a Shell?
    • Running Scripts
    • Specifying the Script's Interpreter
    • The PATH Environment Variable
    • Sub-shells

  3. Variables

    • Shell Variables
    • The read Command
    • The export Command
    • The Shell Environment
    • Parameter Expansion
    • Command Substitution

  4. The Login Process

    • The Login Process
    • The System Profile Script
    • Your .bash_profile Script
    • The . Command

  5. Conditional Statements

    • The Exit Status of Commands
    • Command Line Examples
    • The test Command
    • The if-then-else Construct
    • The elif Construct
    • case Statements

  6. Loops

    • The for Loop
    • The while Loop
    • break and continue
    • Reading Lines From Files
    • Using Arrays with Loops

  7. Special Variables

    • $$ - PID of Shell
    • Command-Line Arguments
    • $# - Number of Arguments
    • $* - All Arguments
    • The shift Command
    • The set Command
    • Getting Options

  8. Quoting Mechanisms

    • Single vs. Double Quotes
    • What is a Here Document?
    • Using a Here Document
    • Here Document Quoting
    • Ignoring Leading Tabs

  9. Functions

    • Shell Functions
    • Passing Arguments to Functions
    • Returning Values from Functions
    • Function Declarations

  10. Advanced Programming

    • Shell Arithmetic
    • The select Statement
    • Terminal Independence in Scripts
    • The eval Command

  11. Debugging Techniques

    • Using echo
    • Using Standard Error
    • Script Tracing
    • Options for Debugging
    • Conditional Debugging
4/2003/CJ

© 2007 Verhoef Training, Inc.