What Is Bash? The Bourne Again Shell Explained
Bash is a widely used Unix shell and scripting language, the default command interpreter on most Linux systems and most CI runners.
Bash, short for "Bourne Again SHell," is the program that runs the vast majority of shell scripts in the world, including most steps in a CI pipeline. It is compatible with the older Bourne shell but adds arrays, better string handling, and many conveniences. Because it is so common, "shell script" and "Bash script" are often used interchangeably.
Where Bash came from
Bash was written as a free replacement for the original Bourne shell (sh) from Unix. It kept backward compatibility while adding features, and became the default login shell on most Linux distributions.
Bash vs sh
Plain sh is a minimal POSIX shell; Bash is a superset with extras like arrays, [[ ]] tests, and process substitution. A script that uses Bash-only features will break if run by sh, which is a common cause of "works locally, fails in CI" bugs.
What Bash adds
- Arrays and associative arrays for structured data.
- The
[[ ]]test construct with pattern matching. - Brace expansion like
file.{js,css}. - The
set -o pipefailoption for safer pipelines.
Bash as a scripting language
Bash is more than a prompt: it has variables, loops, functions, and conditionals. CI pipelines lean on it heavily to glue together build tools, run tests, and shape output, so a little Bash fluency goes a long way.
Why Bash matters in CI
Most workflow run: steps execute through Bash by default on Linux. The reliable way to make a Bash CI script fail loudly on the first error is to start it with set -euo pipefail, which turns silent failures into stopped jobs.
Bash on managed runners
Latchkey runners ship a standard Bash so the same script runs identically every time. You still control the strictness: adding set -euo pipefail at the top of a step is the single highest-leverage habit for trustworthy pipelines.
Key takeaways
- Bash is the default shell on most Linux systems and CI runners.
- It is a superset of POSIX sh, so Bash-only features can break under plain sh.
- Starting scripts with
set -euo pipefailmakes Bash fail fast and loud in CI.