Bash: The Ubiquitous Shell and Scripting Language

Shriira Press

Preface

A comprehensive, self-contained guide to Bash (the Bourne-Again Shell) — the most widely deployed shell on Earth and the de-facto standard for shel…

Welcome to Bash: The Ubiquitous Shell and Scripting Language.

A comprehensive, self-contained guide to Bash (the Bourne-Again Shell) — the most widely deployed shell on Earth and the de-facto standard for shell scripting. Bash runs almost everywhere: it's the default on most Linux distributions, the backbone of CI pipelines, Docker images, and server automation, and the language of countless .sh scripts that hold the software world together. This book teaches Bash as it's actually used — both as an interactive shell and, above all, as a scripting language for robust automation — covering variables and quoting, expansions, word splitting and globbing, arrays, conditionals, loops, functions and scripts, I/O and process management, and the production essentials: writing robust scripts (set -euo pipefail, traps), portability (POSIX sh vs bashisms), and ShellCheck. It blends intuition (what the shell is doing and why), concepts (the rules — especially the ones that bite), and runnable code (real bash you can paste and adapt).

This title is part of the ShriIra library and is free to read in full, right here — our small contribution to making world-class knowledge easy to reach.

A note on reading it: open the Contents menu at the top of the reader to jump between chapters, use the Aa menu to set a comfortable text size, theme (light, sepia, or night), and single- or two-page layout. Your place is saved automatically, so you can always pick up where you left off.

We hope it serves you well.

— Shriira Press

Contents

  1. Chapter 1 — What Is Bash?
  2. Chapter 2 — Getting Started: The Command Line and Bash Basics
  3. Chapter 3 — Variables, Parameters, and Quoting
  4. Chapter 4 — Expansions: Brace, Tilde, Parameter, Command, Arithmetic, Glob
  5. Chapter 5 — Word Splitting, Globbing, and the Perils of Unquoted Variables
  6. Chapter 6 — Arrays and Associative Arrays
  7. Chapter 7 — Conditionals and Tests
  8. Chapter 8 — Control Flow: Loops and case
  9. Chapter 9 — Functions, Scripts, and Arguments
  10. Chapter 10 — I/O, Redirection, Pipes, and Process Management
  11. Chapter 11 — Writing Robust Scripts
  12. Chapter 12 — Portability, Debugging, and ShellCheck
  13. Chapter 13 — Bash in Practice and the Profession
  14. Appendix A — Glossary and Quick Reference
  15. Appendix B — Further Reading and Resources
0%
1/1