Bash Next Steps
Published by O'Reilly Media, Inc.
Advance your knowledge of the most commonly used technology in tech
Nearly all software engineers working on a Mac or Linux machine use bash on a daily basis, for tasks such as writing CI/CD pipelines, managing Kubernetes clusters, writing maintenance scripts, and initializing cloud virtual machines. Unfortunately bash is often not taken seriously as a tool, which leads to confusion and misuse that can baffle users.
Join expert Ian Miell to build the foundation necessary to write more sophisticated and robust scripts. You’ll explore many of bash’s more advanced features, including job management, subshells, traps and signals, and process substitution. Along the way, you’ll also dive into debugging and improving others’ scripts.
What you’ll learn and how you can apply it
By the end of this live online course, you’ll understand:
- How to create robust bash scripts
- How to set options in your bash shell
- Key concepts like signals, traps, debugging techniques, and process substitution
And you’ll be able to:
- Write your own bash scripts
- Write superrobust scripts that trap exit codes
- Quickly debug and diagnose problems with other people’s scripts
- Speed up your scripts significantly by using little-known bash features
This live event is for you because...
- You’re a software engineer.
- You want to build on your bash knowledge.
- You want to become a senior engineer.
Prerequisites
- A computer with access to a bash shell via any standard terminal program
- Familiarity with the command line
- A basic understanding of bash (equivalent to the concepts covered in Introduction to the bash Shell)
Recommended preparation:
- Answer the following questions in note form: What tasks would you like to solve using bash? What bash features or applications are of particular interest to you?
Recommended follow-up:
- Read Learning the bash Shell, third edition (book)
- Read bash Cookbook, second edition (book)
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
Bash scripting: Part 1 (55 minutes)
- Group discussion: What do you want to do with bash? What’s your experience with bash?
- Presentation: Basic variables; globbing; pipes and redirects; functions; tests; loops; command substitution; scripts and startup; bash options
- Hands-on exercise: Write a script to retrieve the output of a site in a loop; output whether a keyword was seen on the page
- Q&A
Break (5 minutes)
Bash scripting: Part 2 (55 minutes)
- Presentation: Subshells; IFS; backgrounding tasks
- Hands-on exercise: Write a script that searches through subfolders looking for files that match a grep; use subshells and IFS where appropriate
- Q&A
Break (5 minutes)
Advanced bash (50 minutes)
- Presentation: Traps and signals; process substitution
- Hands-on exercise: Write a script that’s as difficult as possible to quit from
Wrap-up and Q&A (10 minutes)
Your Instructor
Ian Miell
Ian Miell has over 25 years of experience consulting on, writing, running, architecting, and maintaining software and infrastructure for dozens of businesses from large to small. He’s also the author of Docker in Practice (Manning), Learn Bash the Hard Way (Leanpub) as well as various training courses for O'Reilly Media and others. He now focuses on helping organizations make changes to their tech and management stacks from the bottom up.