O'Reilly logo
live online training icon Live Online training

Bash Shell Scripting in 4 Hours

Get started with Bash

Sander van Vugt

Bash is used as the default shell on Linux, UNIX and Mac OS systems around the globe and Bash shell scripts are used to automate tasks. In this course students will learn the essentials for Bash shell scripting. Learn how to interpret Bash shell scripts and also how to develop new Bash shell scripts. Get up and running today.

What you'll learn-and how you can apply it

  • Learn how to write your first hello world shell script
  • See how to work with variables
  • Use positional parameters
  • Apply pattern matching substitution
  • Explore looping structures in shell scripts

This training course is for you because...

  • This Training provides candidate with the basic skills that are required for working with Bash shell scripts

Prerequisites

  • Basic knowledge or experience with Linux is recommended

REQUIRED SETUP:

To follow along with the hands-on parts of this course, you are invited to create a new (virtual) machine before the start of the course. Build it according to the following specifications: 1 virtual machine with any Linux distribution, hardware specs are not important.

Recommended Preparation:

A basic understanding of Linux will help participants. This knowledge can be found in "Beginning Linux System Administration" (video)

About your instructor

  • Sander van Vugt has been teaching Linux since 1995 and has written more than 60 books about different Linux related topics. Sander is the author of the best-selling previous editions of the RHCSA Complete Video Course, as well as many other Red Hat related video courses. He is also a regular speaker on major Linux conferences all over the world.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Segment 1: Writing a shell script with all basic elements (30 minutes)

  • Students will learn how to write a shell script with all the basic elements, including best practices for writing readable shell scripts.

Segment 2: Working with Variables (40 minutes)

  • Students will learn how to use variables in shell scripts.
  • 15 minute break

Segment 3: Using Positional Parameters (35 minutes)

  • Students will learn how to use command line arguments with shell scripts and how to process their values within the scripts.

Segment 4: Applying Pattern Matching substituion (35 minutes)

  • Students will learn how to manipulate text strings in shell scripts, to shape them exactly as required for specific tasks.
  • 15 minute break

Segment 5: Using looping structures (70 minutes)

  • Students will learn how to work with common looping structures, such as if, case, for and while.