Synopses & Reviews
O'Reilly's bestselling book on Linux's bash shell is at it again. Now that Linux is an established player both as a server and on the desktop Learning the bash Shell has been updated and refreshed to account for all the latest changes. Indeed, this third edition serves as the most valuable guide yet to the bash shell.As any good programmer knows, the first thing users of the Linux operating system come face to face with is the shell the UNIX term for a user interface to the system. In other words, it's what lets you communicate with the computer via the keyboard and display. Mastering the bash shell might sound fairly simple but it isn't. In truth, there are many complexities that need careful explanation, which is just what Learning the bash Shell provides.If you are new to shell programming, the book provides an excellent introduction, covering everything from the most basic to the most advanced features. And if you've been writing shell scripts for years, it offers a great way to find out what the new shell offers. Learning the bash Shell is also full of practical examples of shell commands and programs that will make everyday use of Linux that much easier. With this book, programmers will learn:
- How to install bash as your login shell
- The basics of interactive shell use, including UNIX file and directory structures, standard I/O, and background jobs
- Command line editing, history substitution, and key bindings
- How to customize your shell environment without programming
- The nuts and bolts of basic shell programming, flow control structures, command-line options and typed variables
- Process handling, from job control to processes, coroutines and subshells
- Debugging techniques, such as trace and verbose modes
- Techniques for implementing system-wide shell customization and features related to system security
Synopsis
Our bestselling book on bash is back for more
Synopsis
It's simple: you need to know how to work with the bash shell if you want to get to the heart of Mac OS X, Linux, and other Unix systems. Updated for the most recent version of bash, this concise little book puts all of the essential information about bash at your fingertips. You'll quickly find answers to annoying questions that always come up when you're writing shell scripts -- What characters do you need to quote? How do you get variable substitution to do exactly what you want? How do you use arrays? -- and much more.
If you're a user or programmer of any Unix variant, or if you're using bash on Windows, you'll find this pocket reference indispensable. This book covers:
- Invoking the Shell
- Syntax
- Functions
- Variables
- Arithmetic Expressions
- Command History
- Programmable Completion
- Job Control
- Shell Options
- Command Execution
- Coprocesses
- Restricted Shells
- Built-in Commands
About the Author
Arnold Robbins, an Atlanta native, is a professional programmer and technical author. He has worked with Unix systems since 1980, when he was introduced to a PDP-11 running a version of Sixth Edition Unix. He has been a heavy AWK user since 1987, when he became involved with gawk, the GNU project's version of AWK. As a member of the POSIX 1003.2 balloting group, he helped shape the POSIX standard for AWK. He is currently the maintainer of gawk and its documentation. He is also coauthor of the sixth edition of O'Reilly's Learning the vi Editor. Since late 1997, he and his family have been living happily in Israel.
Table of Contents
Preface; bash Versions; Summary of bash Features; Intended Audience; Code Examples; Chapter Summary; Conventions Used in This Handbook; We'd Like to Hear from You; Using Code Examples; Safari Enabled; Acknowledgments for the First Edition; Acknowledgments for the Second Edition; Acknowledgments for the Third Edition; Chapter 1: bash Basics; 1.1 What Is a Shell?; 1.2 Scope of This Book; 1.3 History of UNIX Shells; 1.4 Getting bash; 1.5 Interactive Shell Use; 1.6 Files; 1.7 Input and Output; 1.8 Background Jobs; 1.9 Special Characters and Quoting; 1.10 Help; Chapter 2: Command-Line Editing; 2.1 Enabling Command-Line Editing; 2.2 The History List; 2.3 emacs Editing Mode; 2.4 vi Editing Mode; 2.5 The fc Command; 2.6 History Expansion; 2.7 readline; 2.8 Keyboard Habits; Chapter 3: Customizing Your Environment; 3.1 The .bash_profile, .bash_logout, and .bashrc Files; 3.2 Aliases; 3.3 Options; 3.4 Shell Variables; 3.5 Customization and Subprocesses; 3.6 Customization Hints; Chapter 4: Basic Shell Programming; 4.1 Shell Scripts and Functions; 4.2 Shell Variables; 4.3 String Operators; 4.4 Command Substitution; 4.5 Advanced Examples: pushd and popd; Chapter 5: Flow Control; 5.1 if/else; 5.2 for; 5.3 case; 5.4 select; 5.5 while and until; Chapter 6: Command-Line Options and Typed Variables; 6.1 Command-Line Options; 6.2 Typed Variables; 6.3 Integer Variables and Arithmetic; 6.4 Arrays; Chapter 7: Input/Output and Command-Line Processing; 7.1 I/O Redirectors; 7.2 String I/O; 7.3 Command-Line Processing; Chapter 8: Process Handling; 8.1 Process IDs and Job Numbers; 8.2 Job Control; 8.3 Signals; 8.4 trap; 8.5 Coroutines; 8.6 Subshells; 8.7 Process Substitution; Chapter 9: Debugging Shell Programs; 9.1 Basic Debugging Aids; 9.2 A bash Debugger; Chapter 10: bash Administration; 10.1 Installing bash as the Standard Shell; 10.2 Environment Customization; 10.3 System Security Features; Chapter 11: Shell Scripting; 11.1 What's That Do?; 11.2 Starting Up; 11.3 Potential Problems; 11.4 Don't Use bash; Chapter 12: bash for Your System; 12.1 Obtaining bash; 12.2 Unpacking the Archive; 12.3 What's in the Archive; 12.4 Who Do I Turn to?; Appendix A: Related Shells; A.1 The Bourne Shell; A.2 The IEEE 1003.2 POSIX Shell Standard; A.3 The Korn Shell; A.4 pdksh; A.5 zsh; A.6 Shell Clones and Unix-like Platforms; Appendix B: Reference Lists; B.1 Invocation; B.2 Prompt String Customizations; B.3 Built-In Commands and Reserved Words; B.4 Built-In Shell Variables; B.5 Test Operators; B.6 set Options; B.7 shopt Options; B.8 I/O Redirection; B.9 emacs Mode Commands; B.10 vi Control Mode Commands; Appendix C: Loadable Built-Ins; Appendix D: Programmable Completion; Colophon;