Chapter 11. bash for Your System

The first ten chapters of this book have looked at nearly all aspects of bash, from navigating the file system and command-line editing to writing shell scripts and functions using lesser-known features of the shell. This is all very well and good, but what if you have an old version of bash and want the new features shown in this book (or worse yet, you don’t have bash at all)?

In this chapter we’ll show you how to get the latest version of bash and how to install it on your system, and we’ll discuss potential problems you might encounter along the way. We’ll also look briefly at the examples that come with bash and how you can report bugs to the bash maintainer.

Obtaining bash

If you have a direct connection to the Internet, you should have no trouble obtaining bash; otherwise, you’ll have to do a little more work.

bash is available from a number of anonymous FTP sites. The following list (giving host name, IP address, and directory name) is a good starting point:

prep.ai.mit.edu (18.159.0.42) /pub/gnu
sunsite.unc.edu (152.2.254.81) /pub/gnu
plaza.aarnet.edu.au (139.130.23.2) /gnu
ftp.isy.liu.se (130.236.20.12) /pub/gnu
unix.hensa.ac.uk (129.12.200.129) /mirrors/gnu

prep.ai.mit.edu is the official GNU site and will always have the most up-to-date copy of bash. The other sites listed mirror the official site, so barring any major changes, they should also have the most recent version. To reduce load on the GNU site, it’s best to get bash from ...

Get Learning the bash Shell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.