UMBC Training Centers logo

Linux Shell Programming

 

Course Description | Outline | IT Home

Linux Processes

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

Getting Started

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

Variables

  • Shell Variables
  • The read Command
  • The export Command
  • The Shell Environment
  • Variable Substitution
  • Command Substitution

The Login Process

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

Conditional Statements

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

 Loops

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

Special Variables

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

Quoting Mechanisms

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

Functions

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

Advanced Programming

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

Debugging Techniques

  • Using echo
  • Using Standard Error
  • Options for Debugging
  • Script Tracing
  • Conditional Debugging

Shell IPC

  • Co-processes
  • The print and read Commands
  • Signals
  • The trap Command
  • Named Pipes
  • The wait Command

Data Munging

  • Regular Expression Overview
  • Regular Expressions
  • RE Character Classes
  • RE Quantifiers
  • RE Parenthesis
  • Searching Inside Files
  • Replacing Text Characters
  • The Streaming Editor (sed)
  • Text Processing with awk
  • Text Sorting
  • Duplicate Removal Utility
  • Extracting Columns of Text

Security, Whitespace And Other Gotchas

  • Gotchas: Maximum Command Length
  • Gotcha: Whitespace in for Loops
  • Gotcha: $IFS
  • Gotcha: Printing in .bashrc
  • Gotcha: Aliases

Administering the Linux System by Using Shell Scripts

  • Manage Services
  • Monitor System Resources
  • Manage System Logs
  • Manage Users and Groups

Performing Backups Using Shell Scripts

  • Create Simple Backup Scripts
  • Specify the Backup Source and Destination Interactively
  • Manage Logs
  • Restore Files

Packaging Shell Programs

  • Create Portable Shell Scripts
  • Create Shell Wrappers