Unpacking the Archive

Having obtained the archive file by one of the above methods, you need to unpack it and install it on your system. Unpacking can be done anywhere—we’ll assume you’re unpacking it in your home directory. Installing it on the system requires you to have root privileges. If you aren’t a system administrator with root access, you can still compile and use bash; you just can’t install it as a system-wide utility. The first thing to do is uncompress the archive file by typing gunzip bash-2.01.tar.gz. [140] Then you need to “untar” the archive by typing tar -xf bash-2.01.tar. The -xf means “extract the archived material from the specified file.” This will create a directory called bash-2.01 in your home directory.

The archive contains all of the source code needed to compile bash and a large amount of documentation and examples. We’ll look at these things and how you go about making a bash executable in the rest of this chapter.

[140] gunzip is the GNU decompression utility. gunzip is popular but relatively new and some systems don’t have it. If your system doesn’t, you can obtain it by the same methods as you obtained bash. gunzip is available from the FSF. gzip -d does the same thing as gunzip.

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.