Linux System Engineer: Bash Shell Scripting for Automation
57mIntermediate2019-04-26
Authors

Grant McWilliams
Consultant, Speaker, Writer, Professor, Developer
Course details
Learn how to use bash scripting to automate common tasks on Red Hat Enterprise Linux (RHEL)—one of the most popular Linux distributions. This course covers the foundations of creating and debugging bash scripts, including scripts that accept input via positional arguments, pipes, and file parsing. Plus, learn how to get data out of bash scripts and set up conditional and looping code blocks. Grant also solves some real-world problems, using bash to monitor user space and CPU usage.
Note: This course also helps you study to pass the Red Hat Certified Engineer (RHCE) exam—the benchmark certification for Red Hat Enterprise Linux.
Learning objectives
Basics of bash scripting
Bash debugging
Loading files in scripts
Prompting for input
Piping data into a script
Outputting data from a script
Controlling the flow of bash scripts with conditions
Looping bash scripts
Reviewing real-world examples
Note: This course also helps you study to pass the Red Hat Certified Engineer (RHCE) exam—the benchmark certification for Red Hat Enterprise Linux.
Learning objectives
Basics of bash scripting
Bash debugging
Loading files in scripts
Prompting for input
Piping data into a script
Outputting data from a script
Controlling the flow of bash scripts with conditions
Looping bash scripts
Reviewing real-world examples
Skills covered
CentOSRed Hat Enterprise LinuxRed HatIT AutomationNetwork AdministrationCert PrepNetwork and System AdministrationOpen Source
Concepts
Introduction
- Bash scripting for automation
- What you will need
Introduction to Linux Scripting
- Introduction to bash
- What makes a shell script a shell script
- Using bash debugging mode
- Bash variable scope
Using Outside Data in a Script
- Positional arguments
- Load files using while read
- Load files into arrays with mapfile
- Prompt for input
- Pipe data into a script
- Process shell options
Outputting Data from a Script
- Saving data to files
- Outputting to STDOUT and STDERR
Bash Logic
- Conditional flow with if, then fi
- Conditional flow with case
- Numeric conditions
- String conditions
- File conditions
Bash Loops
- For loop
- While loop
Real-World Examples
- Monitoring user space usage
- Monitoring CPU usage
Conclusion
- Next steps