Bash Programming Books
Bash (acronym for the ‘Bourne-Again-SHell’) is the GNU Project’s shell and programming language. It’s an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). Bash has become a de facto standard for shell scripting. It runs on almost all versions of Unix and a few other operating systems including Windows platforms.
A Unix shell is both a command interpreter and a programming language. As a command interpreter, the shell provides the user interface to various utilities. The programming language features of Bash allow these utilities to be combined. Files containing commands can be developed, and become commands themselves. A shell script is therefore a quick way of prototyping a complex application. Shell scripting follows the classic Unix philosophy of breaking complex projects into simpler subtasks, of chaining together components and utilities.
Like all Unix shells, Bash supports filename globbing (wildcard matching), piping, here documents, command substitution, variables and control structures for condition-testing and iteration. The keywords, syntax and other basic features of the language were all copied from sh. Other features, e.g., history, were copied from csh and ksh. Bash is a POSIX shell, but with a number of extensions.
We publish a series covering the best open source programming books for other popular languages. Read them here.
By Mendel Cooper (916 pages)
Advanced Bash-Scripting Guide is an in-depth exploration of the art of scripting. Almost the complete set of commands, utilities, and tools is available for invocation by a shell script.
The book explains:
This book is in the public domain.
By Chet Ramey, Brian Fox (166 pages)
GNU Bash Reference Manual is the definitive reference for GNU Bash, the standard GNU command-line interpreter.
GNU Bash is a complete implementation of the POSIX2 shell specification (/bin/sh), with additional features from the C-shell (csh) and Korn shell (ksh). The name is an acronym for the ‘Bourne-Again SHell’, a pun on Stephen Bourne, the author of the direct ancestor of the current Unix shell sh, which appeared in the Seventh Edition Bell Labs Research version of Unix.
The book explores:
By Machtelt Garrels (165 pages)
Everybody working on a UNIX or UNIX-like system who wants to make life easier on themselves, power users and sysadmins alike, can benefit from reading this book. Learn about Bash programming.
The book is released under an open source license.
By William D. Shotts, Jnr (540 pages)
The Linux Command Line includes an excellent primer on Bash scripting. It also offers a broad overview of ‘living’ on the Linux command line. Unlike some books that concentrate on just a single program, such as the shell, bash, this book will try to convey how to get along with the command line interface in a larger sense. How does it all work? What can it do? What’s the best way to use it?
The book is divided into the following parts:
The book is released under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported (CC BY-NC-ND 3.0) license.
By Vivek Gite and Contributors (294 pages)
The book starts by describing Linux and simple scripts to automate frequently executed commands and moves on to describing conditional logic, user interaction, loops, menus, traps, and functions. The book ends with various sys administration related scripts such as making a backup, using cron jobs, writing interactive tools, web based tools, remote login, ftp and database backup related scripts.
The book is aimed at system administrators and students. It teachers the reader how to read, write, and debug Linux shell scripts using the Bash shell.
Linux Shell Scripting Tutorial is available under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported license.
By Maarten Billemont (HTML)
The Bash Guide teaches both newcomers and long-time users the best, safest and most robust ways of writing powerful bash programming scripts as well as making efficient and speedy interactive use of the shell.
The book explores:
This guide is open source, licensed under Creative Commons Attribution-ShareAlike 4.0 International License (CC-BY-SA). It’s a work-in-progress.