The System Administrator’s Guide to Bash Scripting

Course Instructor
course instructor image
Terrence Cox
A veteran of twenty years in Information Technology in a variety of roles. He has worked in development, security and infrastructure well before they merged into what we now call DevOps. He provides training in Linux, VMWare, DevOps (Ansible, Jenkins, etc) as well as containers and AWS topics.

Introduction

Syllabus

00:08:02

History of Bash

00:06:01

Core Concepts

Bash Files - .bash_profile

00:07:32

Bash Files - .bashrc

00:07:02

Bash Files - .bash_history

00:07:08

Bash Files - .bash_logout

00:07:01

What Makes a File a Shell Script?

00:08:32

Displaying Environment Variables in a Script

00:07:23

Using Variables on the Command Line

00:10:05

Setting and Using Variables in Scripts

00:09:06

Comment Types and Structure

00:08:34

Command Substitution

00:10:17

Exit Status

00:07:53

Arithmetic Operations

00:07:53

Global and Local Environment Variables

00:06:34

Special Characters - Quotes and Escapes

00:07:54

Using /dev/null

00:06:37

The Read Statement

00:08:07

Shell Expansion

00:08:05

Types of Variables (Implicit vs. Explicit Definition)

00:11:19

Arrays

00:12:22

Exercise: Display Environment Variables

00:30:00

Exercise: Setting and Using Variables in Scripts

00:30:00

Exercise: Using Comments

00:30:00

Exercise: Using /dev/null

00:30:00

Exercise: Exit Status Types

00:30:00

Exercise: Evaluating Arithmetic Expressions

00:30:00

Exercise: Command Substitution

00:30:00

Exercise: Interactive Scripting

00:30:00

Exercise: Using Arrays

00:30:00

Conditional Statements

Passing Variables to Scripts at the Command Line

00:09:00

The If Statement

00:16:49

If/Then/Else

00:16:16

For Loop

00:09:54

Case Statement

00:08:43

While Loop

00:08:25

Execution Operators (&& and ||)

00:09:30

Exercise: Passing Variables to Scripts at the Command Line

00:30:00

Exercise: The If Statement

00:30:00

Exercise: Using If/Then/Else

00:30:00

Exercise: The For Statement

00:30:00

Exercise: Using the Case Statement

00:30:00

Exercise: While Looping

00:30:00

Input and Output

Reading Files

00:07:06

File Descriptors and Handles

00:08:33

IFS and Delimiting

00:09:10

Traps and Signals

00:11:35

Exercise: Reading Files

00:30:00

Exercise: File Descriptors and Handles

00:30:00

Exercise: IFS and Delimiting

00:30:00

Exercise: Traps and Signals

00:30:00

Debugging and Error Handling

Debugging Your Script

00:08:45

Error Handling

00:10:10

Exercise: Error Handling with Exit

00:30:00

Functions

Simple Functions

00:08:06

Structure of Functions in a Script

00:11:19

Variable Scope in Functions

00:09:47

Functions with Parameters

00:08:02

Nested Functions

00:12:20

Function Return and Exit

00:14:09

Exercise: Creating a Function

00:30:00

Exercise: Variable Scope in Functions

00:30:00

Exercise: Functions with Parameters

00:30:00

Exercise: Nested Functions

00:30:00

Samples/Use Cases

Using the InfoBox

00:12:38

Display a MessageBox for Confirmation

00:12:00

Advanced UI - Building a Menu System

00:12:20

The InputBox

00:08:20

Overriding Events

00:10:44

Quickly Checking Command Line Parameters

00:07:23

Building a Document Generator

00:09:49

Exercise: Simple Infobox

00:30:00

Exercise: Displaying a Message Box

00:30:00

Exercise: A User Input Box

00:30:00

Exercise: Creating a Menu

00:30:00

Conclusion

Conclusion and Next Steps

00:03:54

Details

In this course, you will develop all of the skills needed to write effective and complex shell scripts that can automate mundane tasks and complex implementations. We will walk you through all of the major components and key words in shell scripting (loops, conditionals, functions, error handling, traps, signals and more) so you can effectively write your scripts to handle any situation. You will find a comprehensive study guide, an instructor note card set and a full SIXTEEN PAGES of sample shell scripts developed during the course, all available for your download and reference.

Study Guides

Course Bash Scripts - Full Listing

This is a full listing of ALL the bash scripts created during the course.

The System Administrator's Guide to Bash Study Guide

Instructor Deck

Community

Looking For Team Training?

Learn More