Learning the bash Shell
By: Cameron Newham and Bill Rosenblatt.
Contributors: Rosenblatt, Bill.
Edition: 3rd Edition, covers bash 3.0
Publisher: O’Reilly Media
Published: 2005 04
Place of publication: Beijing; Sesbastopol, [Calif.]
Language: eng
Format: Paperback
Number of pages: 333
ISBN-13: 9780596009656
Copyright date: 2005
Subjects: UNIX shells.; UNIX (Computer file); User interfaces (Computer systems)
Description: Learning the bash Shell, Third Edition, is the definitive guide to bash, the Free Software Foundation's "Bourne Again Shell." It's a freely available replacement for the UNIX Bourne shell, and is the shell of choice for users of Linux, Mac OS X, BSD, and other UNIX systems.

You'll find this guide valuable whether you're interested in bash as a user interface or for its powerful programming capabilities. This book will teach you how to use bash's advanced command-line features, such as command history, command-line editing, and command completion.

This book also introduces shell programming,a skill no UNIX or Linus user should be without. The book demonstrates what you can do with bash's programming features. You'll learn about flow control, signal handling, and command-line processing and I/O. There is also a chapter on debugging your bash programs.

Finally, Learning the bash Shell, Third Edition, shows you how to acquire, install, configure, and customize bash, and gives advice to system administrators managing bash for their user communities.

This Third Edition covers all of the features of bash Version 3.0, while still applying to Versions 1.x and 2.x. It includes a debugger for the bash shell, both as an extended example and as a useful piece of working code. Since shell scripts are a significant part of many software projects, the book also discusses how to write maintainable shell scripts. And, of course, it discusses the many features that have been introduced to bash over the years: one-dimensional arrays, parameter expansion, pattern-matching operations, new commands, and security improvements.

Unfailingly practical and packed with examples and questions for future study, Learning the bash Shell Third Edition is a valuable asset for Linux and other UNIX users.
--back cover
Notes: Includes index.
Table of contents: title: Preface; title: bash Versions; title: Summary of bash Features; title: Intended Audience; title: Code Examples; title: Chapter Summary; title: Conventions Used in This Handbook; title: We’d Like to Hear from You; title: Using Code Examples; title: Safari Enabled; title: Acknowledgments for the First Edition; title: Acknowledgments for the Second Edition; title: Acknowledgments for the Third Edition; title: 1. bash Basics; title: 1.1. What Is a Shell?; title: 1.2. Scope of This Book; title: 1.3. History of UNIX Shells; title: 1.3.1. The Bourne Again Shell; title: 1.3.2. Features of bash; title: 1.4. Getting bash; title: 1.5. Interactive Shell Use; title: 1.5.1. Commands, Arguments, and Options; title: 1.6. Files; title: 1.6.1. Directories; title: 1.6.1.1. The working directory; title: 1.6.1.2. Tilde notation; title: 1.6.1.3. Changing working directories; title: 1.6.2. Filenames, Wildcards, and Pathname Expansion; title: 1.6.3. Brace Expansion; title: 1.7. Input and Output; title: 1.7.1. Standard I/O; title: 1.7.2. I/O Redirection; title: 1.7.3. Pipelines; title: 1.8. Background Jobs; title: 1.8.1. Background I/O; title: 1.8.2. Background Jobs and Priorities; title: 1.9. Special Characters and Quoting; title: 1.9.1. Quoting; title: 1.9.2. Backslash-Escaping; title: 1.9.3. Quoting Quotation Marks; title: 1.9.4. Continuing Lines; title: 1.9.5. Control Keys; title: 1.10. Help; title: 2. Command-Line Editing; title: 2.1. Enabling Command-Line Editing; title: 2.2. The History List; title: 2.3. emacs Editing Mode; title: 2.3.1. Basic Commands; title: 2.3.2. Word Commands; title: 2.3.3. Line Commands; title: 2.3.4. Moving Around in the History List; title: 2.3.5. Textual Completion; title: 2.3.6. Miscellaneous Commands; title: 2.4. vi Editing Mode; title: 2.4.1. Simple Control Mode Commands; title: 2.4.2. Entering and Changing Text; title: 2.4.3. Deletion Commands; title: 2.4.4. Moving Around in the History List; title: 2.4.5. Character-Finding Commands; title: 2.4.6. Textual Completion; title: 2.4.7. Miscellaneous Commands; title: 2.5. The fc Command; title: 2.6. History Expansion; title: 2.7. readline; title: 2.7.1. The readline Startup File; title: 2.7.1.1. readline variables; title: 2.7.2. Key Bindings Using bind; title: 2.8. Keyboard Habits; title: 3. Customizing Your Environment; title: 3.1. The .bash_profile, .bash_logout, and .bashrc Files; title: 3.2. Aliases; title: 3.3. Options; title: 3.3.1. shopt; title: 3.4. Shell Variables; title: 3.4.1. Variables and Quoting; title: 3.4.2. Built-In Variables; title: 3.4.2.1. Editing mode variables; title: 3.4.2.2. Mail variables; title: 3.4.2.3. Prompting variables; title: 3.4.2.4. Command search path; title: 3.4.2.5. Command hashing; title: 3.4.2.6. Directory search path and variables; title: 3.4.2.7. Miscellaneous variables; title: 3.5. Customization and Subprocesses; title: 3.5.1. Environment Variables; title: 3.5.1.1. Terminal types; title: 3.5.1.2. Other common variables; title: 3.5.2. The Environment File; title: 3.6. Customization Hints; title: 4. Basic Shell Programming; title: 4.1. Shell Scripts and Functions; title: 4.1.1. Functions; title: 4.2. Shell Variables; title: 4.2.1. Positional Parameters; title: 4.2.1.1. Positional parameters in functions; title: 4.2.2. Local Variables in Functions; title: 4.2.3. Quoting with $@ and $*; title: 4.2.4. More on Variable Syntax; title: 4.3. String Operators; title: 4.3.1. Syntax of String Operators; title: 4.3.2. Patterns and Pattern Matching; title: 4.3.3. Length Operator; title: 4.3.4. Extended Pattern Matching; title: 4.4. Command Substitution; title: 4.5. Advanced Examples: pushd and popd; title: 5. Flow Control; title: 5.1. if/else; title: 5.1.1. Exit Status; title: 5.1.2. Return; title: 5.1.3. Combinations of Exit Statuses; title: 5.1.4. Condition Tests; title: 5.1.4.1. String comparisons; title: 5.1.4.2. File attribute checking; title: 5.1.5. Integer Conditionals; title: 5.2. for; title: 5.3. case; title: 5.4. select; title: 5.5. while and until; title: 6. Command-Line Options and Typed Variables; title: 6.1. Command-Line Options; title: 6.1.1. shift; title: 6.1.2. Options with Arguments; title: 6.1.3. getopts; title: 6.2. Typed Variables; title: 6.3. Integer Variables and Arithmetic; title: 6.3.1. Arithmetic Conditionals; title: 6.3.2. Arithmetic Variables and Assignment; title: 6.3.3. Arithmetic for Loops; title: 6.4. Arrays; title: 7. Input/Output and Command-Line Processing; title: 7.1. I/O Redirectors; title: 7.1.1. Here-documents; title: 7.1.2. File Descriptors; title: 7.2. String I/O; title: 7.2.1. echo; title: 7.2.1.1. Options to echo; title: 7.2.1.2. echo escape sequences; title: 7.2.2. printf; title: 7.2.2.1. Additional bash printf specifiers; title: 7.2.3. read; title: 7.2.3.1. Reading lines from files; title: 7.2.3.2. I/O redirection and multiple commands; title: 7.2.3.3. Command blocks; title: 7.2.3.4. Reading user input; title: 7.3. Command-Line Processing; title: 7.3.1. Quoting; title: 7.3.2. command, builtin, and enable; title: 7.3.3. eval; title: 8. Process Handling; title: 8.1. Process IDs and Job Numbers; title: 8.2. Job Control; title: 8.2.1. Foreground and Background; title: 8.2.2. Suspending a Job; title: 8.3. Signals; title: 8.3.1. Control-Key Signals; title: 8.3.2. kill; title: 8.3.3. ps; title: 8.3.3.1. System V; title: 8.3.3.2. BSD; title: 8.4. trap; title: 8.4.1. Traps and Functions; title: 8.4.2. Process ID Variables and Temporary Files; title: 8.4.3. Ignoring Signals; title: 8.4.4. disown; title: 8.4.5. Resetting Traps; title: 8.5. Coroutines; title: 8.5.1. wait; title: 8.5.2. Advantages and Disadvantages of Coroutines; title: 8.5.3. Parallelization; title: 8.6. Subshells; title: 8.6.1. Subshell Inheritance; title: 8.6.2. Nested Subshells; title: 8.7. Process Substitution; title: 9. Debugging Shell Programs; title: 9.1. Basic Debugging Aids; title: 9.1.1. Set Options; title: 9.1.2. Fake Signals; title: 9.1.2.1. EXIT; title: 9.1.2.2. ERR; title: 9.1.2.3. DEBUG; title: 9.1.2.4. RETURN; title: 9.1.3. Debugging Variables; title: 9.2. A bash Debugger; title: 9.2.1. Structure of the Debugger; title: 9.2.1.1. The driver script; title: 9.2.1.2. exec; title: 9.2.2. The Preamble; title: 9.2.3. Debugger Functions; title: 9.2.3.1. Commands; title: 9.2.3.2. Stepping; title: 9.2.3.3. Breakpoints; title: 9.2.3.4. Break conditions; title: 9.2.3.5. Execution tracing; title: 9.2.3.6. Debugger limitations; title: 9.2.4. A Sample bashdb Session; title: 9.2.5. Exercises; title: 10. bash Administration; title: 10.1. Installing bash as the Standard Shell; title: 10.1.1. POSIX Mode; title: 10.1.2. Command-Line Options; title: 10.2. Environment Customization; title: 10.2.1. umask; title: 10.2.2. ulimit; title: 10.2.3. Types of Global Customization; title: 10.3. System Security Features; title: 10.3.1. Restricted Shell; title: 10.3.2. A System Break-In Scenario; title: 10.3.3. Privileged Mode; title: 11. Shell Scripting; title: 11.1. What’s That Do?; title: 11.1.1. Comments; title: 11.1.2. Variables and Constants; title: 11.2. Starting Up; title: 11.3. Potential Problems; title: 11.4. Don’t Use bash; title: 12. bash for Your System; title: 12.1. Obtaining bash; title: 12.2. Unpacking the Archive; title: 12.3. What’s in the Archive; title: 12.3.1. Documentation; title: 12.3.2. Configuring and Building bash; title: 12.3.3. Testing bash; title: 12.3.4. Potential Problems; title: 12.3.5. Installing bash as a Login Shell; title: 12.3.6. Examples; title: 12.4. Who Do I Turn to?; title: 12.4.1. Asking Questions; title: 12.4.2. Reporting Bugs; title: A. Related Shells; title: A.1. The Bourne Shell; title: A.2. The IEEE 1003.2 POSIX Shell Standard; title: A.3. The Korn Shell; title: A.4. pdksh; title: A.5. zsh; title: A.6. Shell Clones and Unix-like Platforms; title: A.6.1. Cygwin; title: A.6.2. DJGPP; title: A.6.3. MKS Toolkit; title: A.6.4. AT&T UWIN; title: B. Reference Lists; title: B.1. Invocation; title: B.2. Prompt String Customizations; title: B.3. Built-In Commands and Reserved Words; title: B.4. Built-In Shell Variables; title: B.5. Test Operators; title: B.6. set Options; title: B.7. shopt Options; title: B.8. I/O Redirection; title: B.9. emacs Mode Commands; title: B.10. vi Control Mode Commands; title: C. Loadable Built-Ins; title: D. Programmable Completion; title: Index; title: About the Author; title: Colophon; title: Copyright