KnowledgeStep: Linux Shell Scripting

Course GL375: Linux Shell Scripting

Return to Linux Administration Course List

Start Date End Date Price Location Register
No scheduled dates - call for info $  

The GL375 is designed to provide the skills necessary to automate tasks on a Unix or Linux system. Systems Administrators and Developers alike can avoid errors, save time and money by replacing repetitive work patterns with shell scripts.

Care has been taken to present the GL375 in a format that benefits all students, with or without previous programming experience. Guru Labs believes that the best way to learn shell scripting is writing shell scripts. For this reason, lab time is emphasized. Early labs present the scripting process step by step, while later labs are presented in a challenge format. While official solutions to each lab task are provided, students are encouraged to create their own before examining the solution. In this way, more experienced students are challenged without overwhelming the less experienced.


Solid understanding of Unix-based systems and proficiency on the Unix or Linux command line.

Supported Distributions:
Red Hat Enterprise Linux 5
Fedora Core 6
SUSE Linux Enterprise Server 10
SUSE Linux 10.1
Recommended Class Length:
2 days
Detailed Course Outline:
    • Shell Scripting
    • Example Shell Script
    • Shell/Environment Variables
    • Key Environment Variables
    • General Quoting Rules
    • Nesting Commands
    • Variables: Arrays
    • Positional Parameters
    • printf
    • Input and Output
    • alias
    • Functions
    • Colors in Scripts
    Lab Tasks
    • Shell Variables
    • Shell Meta-Characters
    • Command Substitution
    • Aliases
    • Bash Login Scripts
    • Create "userinfo" and "sysinfo" functions
    • Communication Channels
    • File Redirection
    • Piping Commands Together
    • Doing Math
    • Determining Disk Usage
    • cron
    • crontab Format
    • /etc/cron.*/ Directories
    • Sending Email with mail
    Lab Tasks
    • Disk and Filesystem Usage
    • Connecting Commands
    • Regular Expression Overview
    • Regular Expressions
    • RE Character Classes
    • RE Quantifiers
    • RE Parenthesis
    • Searching Inside Files
    • Replacing Text Characters
    • The Streaming Editor
    • Text Processing with awk
    • Text Sorting
    • Duplicate Removal Utility
    • Extracting Columns of Text
    Lab Tasks
    • Pattern Matching with Regular Expressions
    • Extended Regular Expressions
    • Using Regular Expressions With sed
    • Create "rmhost" function
    • Create "showenv" function
    • Parsing Mail Server Logs
    • Fixing Incorrect Files
    • Exit Status
    • Comparisons with test
    • Conditional Statements
    • Flow Control: case
    • The for Loop
    • Flow Control: while and until Loops
    • Reading Files with while
    • Flow Control: select
    Lab Tasks
    • Reporting User Statistics
    • Monitoring Filesystem Usage
    • Gotchas: Maximum Command Length
    • Gotcha: Whitespace in for Loops
    • Gotcha: $IFS
    • Gotcha: Printing in .bashrc
    • Gotcha: Aliases
    Lab Tasks
    • Renaming MP3 Files
    • Split and Display $PATH
    • A tar-based Backup
    • Waterfall Development
    • Iterative Development
    • Getting Help with man and info
    • $MANPATH, whatis and apropos
    • Help from Commands and Documentation
    Lab Tasks
    • Automated Virtual Host Provisioning