چه کسانی این کتاب را می‌خوانند

دانشجوعلاقه‌مند یادگیری
کتابخوان حرفه‌ایلذت مطالعه
نویسندهالهام‌گیری

Learning the bash Shell: Unix Shell Programming (In a Nutshell (O'Reilly))

Cameron Newham and Bill Rosenblatt

قیمت نهایی

۴۹٬۰۰۰ تومان

نسخه اصلی و اورجینال

بلافاصله پس از خرید، فایل کتاب روی دستگاه شما آمادهٔ دانلود است.

تحویل فوری
پرداخت امن
ضمانت فایل
پشتیبانی

مشخصات کتاب

سال انتشار
۲۰۰۵
فرمت
PDF
زبان
انگلیسی
تعداد صفحات
۷ صفحه
حجم فایل
۱٫۷ مگابایت
شابک
9780596009656، 9780596519063، 9780596555009، 0596009658، 0596519060، 0596555008

دربارهٔ کتاب

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 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 1. bash Basics 1.1. What Is a Shell? 1.2. Scope of This Book 1.3. History of UNIX Shells 1.3.1. The Bourne Again Shell 1.3.2. Features of bash 1.4. Getting bash 1.5. Interactive Shell Use 1.5.1. Commands, Arguments, and Options 1.6. Files 1.6.1. Directories 1.6.1.1. The working directory 1.6.1.2. Tilde notation 1.6.1.3. Changing working directories 1.6.2. Filenames, Wildcards, and Pathname Expansion 1.6.3. Brace Expansion 1.7. Input and Output 1.7.1. Standard I/O 1.7.2. I/O Redirection 1.7.3. Pipelines 1.8. Background Jobs 1.8.1. Background I/O 1.8.2. Background Jobs and Priorities 1.9. Special Characters and Quoting 1.9.1. Quoting 1.9.2. Backslash-Escaping 1.9.3. Quoting Quotation Marks 1.9.4. Continuing Lines 1.9.5. Control Keys 1.10. Help 2. Command-Line Editing 2.1. Enabling Command-Line Editing 2.2. The History List 2.3. emacs Editing Mode 2.3.1. Basic Commands 2.3.2. Word Commands 2.3.3. Line Commands 2.3.4. Moving Around in the History List 2.3.5. Textual Completion 2.3.6. Miscellaneous Commands 2.4. vi Editing Mode 2.4.1. Simple Control Mode Commands 2.4.2. Entering and Changing Text 2.4.3. Deletion Commands 2.4.4. Moving Around in the History List 2.4.5. Character-Finding Commands 2.4.6. Textual Completion 2.4.7. Miscellaneous Commands 2.5. The fc Command 2.6. History Expansion 2.7. readline 2.7.1. The readline Startup File 2.7.1.1. readline variables 2.7.2. Key Bindings Using bind 2.8. Keyboard Habits 3. Customizing Your Environment 3.1. The .bash_profile, .bash_logout, and .bashrc Files 3.2. Aliases 3.3. Options 3.3.1. shopt 3.4. Shell Variables 3.4.1. Variables and Quoting 3.4.2. Built-In Variables 3.4.2.1. Editing mode variables 3.4.2.2. Mail variables 3.4.2.3. Prompting variables 3.4.2.4. Command search path 3.4.2.5. Command hashing 3.4.2.6. Directory search path and variables 3.4.2.7. Miscellaneous variables 3.5. Customization and Subprocesses 3.5.1. Environment Variables 3.5.1.1. Terminal types 3.5.1.2. Other common variables 3.5.2. The Environment File 3.6. Customization Hints 4. Basic Shell Programming 4.1. Shell Scripts and Functions 4.1.1. Functions 4.2. Shell Variables 4.2.1. Positional Parameters 4.2.1.1. Positional parameters in functions 4.2.2. Local Variables in Functions 4.2.3. Quoting with $@ and $* 4.2.4. More on Variable Syntax 4.3. String Operators 4.3.1. Syntax of String Operators 4.3.2. Patterns and Pattern Matching 4.3.3. Length Operator 4.3.4. Extended Pattern Matching 4.4. Command Substitution 4.5. Advanced Examples: pushd and popd 5. Flow Control 5.1. if/else 5.1.1. Exit Status 5.1.2. Return 5.1.3. Combinations of Exit Statuses 5.1.4. Condition Tests 5.1.4.1. String comparisons 5.1.4.2. File attribute checking 5.1.5. Integer Conditionals 5.2. for 5.3. case 5.4. select 5.5. while and until 6. Command-Line Options and Typed Variables 6.1. Command-Line Options 6.1.1. shift 6.1.2. Options with Arguments 6.1.3. getopts 6.2. Typed Variables 6.3. Integer Variables and Arithmetic 6.3.1. Arithmetic Conditionals 6.3.2. Arithmetic Variables and Assignment 6.3.3. Arithmetic for Loops 6.4. Arrays 7. Input/Output and Command-Line Processing 7.1. I/O Redirectors 7.1.1. Here-documents 7.1.2. File Descriptors 7.2. String I/O 7.2.1. echo 7.2.1.1. Options to echo 7.2.1.2. echo escape sequences 7.2.2. printf 7.2.2.1. Additional bash printf specifiers 7.2.3. read 7.2.3.1. Reading lines from files 7.2.3.2. I/O redirection and multiple commands 7.2.3.3. Command blocks 7.2.3.4. Reading user input 7.3. Command-Line Processing 7.3.1. Quoting 7.3.2. command, builtin, and enable 7.3.3. eval 8. Process Handling 8.1. Process IDs and Job Numbers 8.2. Job Control 8.2.1. Foreground and Background 8.2.2. Suspending a Job 8.3. Signals 8.3.1. Control-Key Signals 8.3.2. kill 8.3.3. ps 8.3.3.1. System V 8.3.3.2. BSD 8.4. trap 8.4.1. Traps and Functions 8.4.2. Process ID Variables and Temporary Files 8.4.3. Ignoring Signals 8.4.4. disown 8.4.5. Resetting Traps 8.5. Coroutines 8.5.1. wait 8.5.2. Advantages and Disadvantages of Coroutines 8.5.3. Parallelization 8.6. Subshells 8.6.1. Subshell Inheritance 8.6.2. Nested Subshells 8.7. Process Substitution 9. Debugging Shell Programs 9.1. Basic Debugging Aids 9.1.1. Set Options 9.1.2. Fake Signals 9.1.2.1. EXIT 9.1.2.2. ERR 9.1.2.3. DEBUG 9.1.2.4. RETURN 9.1.3. Debugging Variables 9.2. A bash Debugger 9.2.1. Structure of the Debugger 9.2.1.1. The driver script 9.2.1.2. exec 9.2.2. The Preamble 9.2.3. Debugger Functions 9.2.3.1. Commands 9.2.3.2. Stepping 9.2.3.3. Breakpoints 9.2.3.4. Break conditions 9.2.3.5. Execution tracing 9.2.3.6. Debugger limitations 9.2.4. A Sample bashdb Session 9.2.5. Exercises 10. bash Administration 10.1. Installing bash as the Standard Shell 10.1.1. POSIX Mode 10.1.2. Command-Line Options 10.2. Environment Customization 10.2.1. umask 10.2.2. ulimit 10.2.3. Types of Global Customization 10.3. System Security Features 10.3.1. Restricted Shell 10.3.2. A System Break-In Scenario 10.3.3. Privileged Mode 11. Shell Scripting 11.1. What’s That Do? 11.1.1. Comments 11.1.2. Variables and Constants 11.2. Starting Up 11.3. Potential Problems 11.4. Don’t Use bash 12. bash for Your System 12.1. Obtaining bash 12.2. Unpacking the Archive 12.3. What’s in the Archive 12.3.1. Documentation 12.3.2. Configuring and Building bash 12.3.3. Testing bash 12.3.4. Potential Problems 12.3.5. Installing bash as a Login Shell 12.3.6. Examples 12.4. Who Do I Turn to? 12.4.1. Asking Questions 12.4.2. Reporting Bugs 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 A.6.1. Cygwin A.6.2. DJGPP A.6.3. MKS Toolkit A.6.4. AT&T UWIN 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 C. Loadable Built-Ins D. Programmable Completion Index About the Author Colophon Copyright Learning the bash Shell, 3rd Edition 13 Summary of bash Features 16 Intended Audience 18 Code Examples 20 Chapter Summary 21 Conventions Used in This Handbook 24 We&d Like to Hear from You 27 Using Code Examples 28 Safari Enabled 29 Acknowledgments for the First Edition 30 Acknowledgments for the Second Edition 32 Acknowledgments for the Third Edition 33 1. bash Basics 34 1.2. Scope of This Book 38 1.3. History of UNIX Shells 40 1.3.2. Features of bash 43 1.4. Getting bash 45 1.5. Interactive Shell Use 48 1.6. Files 50 1.6.1.2. Tilde notation 54 1.6.1.3. Changing working directories 55 1.6.2. Filenames, Wildcards, and Pathname Expansion 58 1.6.3. Brace Expansion 66 1.7. Input and Output 69 1.7.2. I/O Redirection 74 1.7.3. Pipelines 76 1.8. Background Jobs 79 1.8.2. Background Jobs and Priorities 84 1.9. Special Characters and Quoting 86 1.9.2. Backslash-Escaping 92 1.9.3. Quoting Quotation Marks 94 1.9.4. Continuing Lines 96 1.9.5. Control Keys 98 1.10. Help 103 2. Command-Line Editing 105 2.2. The History List 109 2.3. emacs Editing Mode 110 2.3.2. Word Commands 113 2.3.3. Line Commands 116 2.3.4. Moving Around in the History List 117 2.3.5. Textual Completion 121 2.3.6. Miscellaneous Commands 126 2.4. vi Editing Mode 131 2.4.2. Entering and Changing Text 138 2.4.3. Deletion Commands 141 2.4.4. Moving Around in the History List 145 2.4.5. Character-Finding Commands 149 2.4.6. Textual Completion 153 2.4.7. Miscellaneous Commands 156 2.5. The fc Command 159 2.6. History Expansion 164 2.7. readline 170 2.7.2. Key Bindings Using bind 180 2.8. Keyboard Habits 182 3. Customizing Your Environment 185 3.2. Aliases 191 3.3. Options 197 3.4. Shell Variables 203 3.4.2. Built-In Variables 207 3.4.2.2. Mail variables 219 3.4.2.3. Prompting variables 222 3.4.2.4. Command search path 228 3.4.2.5. Command hashing 231 3.4.2.6. Directory search path and variables 233 3.4.2.7. Miscellaneous variables 235 3.5. Customization and Subprocesses 239 3.5.1.2. Other common variables 247 3.5.2. The Environment File 248 3.6. Customization Hints 250 4. Basic Shell Programming 252 4.2. Shell Variables 262 4.2.2. Local Variables in Functions 268 4.2.3. Quoting with $@ and $* 270 4.2.4. More on Variable Syntax 272 4.3. String Operators 274 4.3.2. Patterns and Pattern Matching 286 4.3.3. Length Operator 294 4.3.4. Extended Pattern Matching 295 4.4. Command Substitution 298 4.5. Advanced Examples: pushd and popd 306 5. Flow Control 313 5.1.2. Return 321 5.1.3. Combinations of Exit Statuses 323 5.1.4. Condition Tests 326 5.1.4.2. File attribute checking 334 5.1.5. Integer Conditionals 343 5.2. for 346 5.3. case 358 5.4. select 363 5.5. while and until 369 6. Command-Line Options and Typed Variables 373 6.1.2. Options with Arguments 379 6.1.3. getopts 380 6.2. Typed Variables 389 6.3. Integer Variables and Arithmetic 393 6.3.2. Arithmetic Variables and Assignment 402 6.3.3. Arithmetic for Loops 414 6.4. Arrays 418 7. Input/Output and Command-Line Processing 427 7.1.2. File Descriptors 439 7.2. String I/O 442 7.2.1.2. echo escape sequences 444 7.2.2. printf 447 7.2.3. read 456 7.2.3.2. I/O redirection and multiple commands 460 7.2.3.3. Command blocks 463 7.2.3.4. Reading user input 466 7.3. Command-Line Processing 472 7.3.2. command, builtin, and enable 481 7.3.3. eval 486 8. Process Handling 507 8.2. Job Control 511 8.2.2. Suspending a Job 516 8.3. Signals 519 8.3.2. kill 522 8.3.3. ps 525 8.3.3.2. BSD 530 8.4. trap 533 8.4.2. Process ID Variables and Temporary Files 538 8.4.3. Ignoring Signals 541 8.4.4. disown 543 8.4.5. Resetting Traps 544 8.5. Coroutines 547 8.5.2. Advantages and Disadvantages of Coroutines 550 8.5.3. Parallelization 552 8.6. Subshells 556 8.6.2. Nested Subshells 558 8.7. Process Substitution 561 9. Debugging Shell Programs 563 9.1.2. Fake Signals 571 9.1.2.2. ERR 575 9.1.2.3. DEBUG 578 9.1.2.4. RETURN 580 9.1.3. Debugging Variables 582 9.2. A bash Debugger 584 9.2.1.2. exec 588 9.2.2. The Preamble 589 9.2.3. Debugger Functions 592 9.2.3.2. Stepping 598 9.2.3.3. Breakpoints 600 9.2.3.4. Break conditions 607 9.2.3.5. Execution tracing 608 9.2.3.6. Debugger limitations 609 9.2.4. A Sample bashdb Session 611 9.2.5. Exercises 615 10. bash Administration 626 10.1.2. Command-Line Options 630 10.2. Environment Customization 637 10.2.2. ulimit 639 10.2.3. Types of Global Customization 644 10.3. System Security Features 646 10.3.2. A System Break-In Scenario 649 10.3.3. Privileged Mode 652 11. Shell Scripting 654 11.1.2. Variables and Constants 658 11.2. Starting Up 660 11.3. Potential Problems 665 11.4. Don&t Use bash 667 12. bash for Your System 668 12.2. Unpacking the Archive 670 12.3. What&s in the Archive 671 12.3.2. Configuring and Building bash 674 12.3.3. Testing bash 681 12.3.4. Potential Problems 682 12.3.5. Installing bash as a Login Shell 683 12.3.6. Examples 685 12.4. Who Do I Turn to? 688 12.4.2. Reporting Bugs 690 A. Related Shells 692 A.2. The IEEE 1003.2 POSIX Shell Standard 699 A.3. The Korn Shell 704 A.4. pdksh 707 A.5. zsh 709 A.6. Shell Clones and Unix-like Platforms 710 A.6.2. DJGPP 712 A.6.3. MKS Toolkit 713 A.6.4. AT&T UWIN 714 B. Reference Lists 715 B.2. Prompt String Customizations 724 B.3. Built-In Commands and Reserved Words 729 B.4. Built-In Shell Variables 740 B.5. Test Operators 762 B.6. set Options 768 B.7. shopt Options 774 B.8. I/O Redirection 784 B.9. emacs Mode Commands 789 B.10. vi Control Mode Commands 798 C. Loadable Built-Ins 805 D. Programmable Completion 814 Colophon 822 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 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 Linux 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.

قیمت نهایی

۴۹٬۰۰۰ تومان