精通Bash脚本编程:GNU/Linux壳层指南

5星 · 超过95%的资源 需积分: 9 177 下载量 45 浏览量 更新于2024-07-22 2 收藏 1.74MB PDF 举报
"Pro.Bash.Programming.Scripting.the.GNULinux.Shell.2nd.Edition" 本书《Pro Bash Programming》第二版是针对Linux和Unix系统管理员的一本指南,旨在教你如何有效地利用Bash shell进行编程。Bash shell不仅是一个连接外部Linux命令的工具,而是一种完整的编程语言。通过充分利用Shell的内部功能,Shell程序可以像用C或其他编译语言编写的实用程序一样快速运行。本书不假设读者具备Unix知识,而是通过标准的编程技术教你如何编写专业的Bash 4.3程序。 本书更新到了Bash 4.3版本,并对许多脚本进行了重写,使其更符合Bash的习惯,更好地利用了Bash特有的特性。内容易读、易懂,将帮助你掌握Bash编程,而不被复杂的语法淹没。 通过阅读本书,你将能够: 1. 使用shell编写新工具并完成大多数编程任务。 2. 利用shell参数扩展替代许多外部命令,使脚本运行速度更快。 3. 避免导致脚本失败的常见错误。 4. 学习如何使用Bash的readline和历史库在获取用户输入时节省打字时间。 5. 掌握Bash 4.0的新特性。 6. 编写能从Web获取信息的shell脚本。 本书适合初学者,特别是那些想要全面掌控自己系统的Linux和Unix系统管理员。 书中的章节涵盖了: 1. 第一章:你好,世界!你的第一个Shell程序 2. 第二章:输入、输出和吞吐量 3. 第三章:循环和分支 4. 第四章:命令行解析和扩展 5. 第五章:参数和变量 6. 第六章:Shell函数 7. 第七章:字符串操作 8. 第八章:文件操作和命令 9. 第九章:保留字和内置命令 10. 第十章:编写无错脚本及调试其他脚本 11. 第十一章:命令行编程 12. 第十二章:运行时配置 13. 第十三章:数据处理 14. 第十四章:脚本屏幕操作 15. 第十五章:初级编程 16. 附录A:Shell变量 这本书提供了一条循序渐进的学习路径,让你能够从基础开始,逐步精通Bash shell编程,提升你在Linux和Unix环境下的工作效率。
2016-04-13 上传
The bash shell is a complete programming language, not merely a glue to combine external Linux commands. By taking full advantage of shell internals, shell programs can perform as snappily as utilities written in C or other compiled languages. And you will see how, without assuming Unix lore, you can write professional bash 4.0 programs through standard programming techniques. * Complete bash coverage * Teaches bash as a programming language * Helps you master bash 4.0 features What you'll learn * Use the shell to write new utilities and accomplish most programming tasks. * Use shell parameter expansion to replace many external commands, making scripts very fast. * Learn to avoid many common mistakes that cause scripts to fail. * Learn how bash's readline and history libraries can save typing when getting user input. * Learn to use features new to bash 4.0. * Build shell scripts that get information from the Web. Who this book is for Beginning Linux and Unix system administrators who want to be in full command of their systems. Table of Contents * Hello, World! Your First Shell Program * Input, Output, and Throughput * Looping and Branching * Command-Line Parsing and Expansion * Parameters and Variables * Shell Functions * String Manipulation * File Operations and Commands * Reserved Words and Builtin Commands * Writing Bug-Free Scripts and Debugging the Rest * Programming for the Command Line * Runtime Configuration * Data Processing * Scripting the Screen * Entry-Level Programming