CHAPTER 15Entry-Level Programming

My preference for bash over any other POSIX shell stems to a great extent from its extensions that enhance interactive programming. The extended options to the read builtin command (which were described in Chapter 9), combined with the history and readline libraries, add functionality that no other shell can match.

Despite its richness, there is still no easy way for the shell to deal with keys such as function keys that generate multiple characters. For that, I present the key-funcs library of functions. The second major section of this chapter describes how to use the mouse in shell scripts and provides a demonstration program.

Between those sections, I deal with checking user input for validity and the history ...

Get Pro Bash Programming: Scripting the GNU/Linux Shell 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.