Mastering Linux Shell Scripting Paperback – January 6, 2016
暫譯: 精通 Linux Shell 腳本編寫
Andrew Mallett
- 出版商: Packt Publishing
- 出版日期: 2015-12-24
- 售價: $1,670
- 貴賓價: 9.5 折 $1,587
- 語言: 英文
- 頁數: 198
- 裝訂: Paperback
- ISBN: 1784396974
- ISBN-13: 9781784396978
-
相關分類:
Linux、Command Line
海外代購書籍(需單獨結帳)
商品描述
Key Features
- Identify the high level steps such as verifying user input, using command lines and conditional statements in creating and executing simple shell scripts
- Create and edit dynamic shell scripts to manage complex and repetitive tasks
- Learn about scripting in Perl and programming in Python as a BASH scripting alternative with this practical, step-by-step guide
Book Description
Shell scripting is a quick method to prototype a complex application or a problem by automating tasks when working on Linux-based systems. Using both simple one-line commands and command sequences complex problems can be solved with ease, from text processing to backing up sysadmin tools.
In this book, you'll discover everything you need to know to master shell scripting and make informed choices about the elements you employ. Get to grips with the fundamentals of creating and running a script in normal mode, and in debug mode. Learn about various conditional statements' code snippets, and realize the power of repetition and loops in your shell script. Implement functions and edit files using the Stream Editor, script in Perl, program in Python – as well as complete coverage of other scripting languages to ensure you can choose the best tool for your project.
What you will learn
- Use the type command to identify the order of command evaluation
- Create interactive scripts that prompt for user input
- Foster menu structures for operators with little command-line experience
- Develop scripts that dynamically edit web configuration files to produce a new virtual host
- Write scripts that use AWK to search and reports on log files
- Draft effective scripts using functions as building blocks, reducing maintenance and build time
- Make informed choices by comparing different script languages such as Perl and Python with BASH
About the Author
Andrew Mallett is the owner of The Urban Penguin and is a comprehensive provider for professional Linux software development, training, and services. Having always been a command-line fan, he feels that so much time can be saved through knowing command-line shortcuts and scripting. TheUrbanPenguin YouTube channel, maintained by Andrew, has well over 800 videos to support this and he has authored four other Packt titles.
Table of Contents
- What and Why of Scripting with Bash
- Creating Interactive Scripts
- Conditions Attached
- Creating Code Snippets
- Alternative Syntax
- Iterating with Loops
- Creating Building Blocks with Functions
- Introducing sed
- Automating Apache Virtual Hosts
- Awk Fundamentals
- Summarizing Logs with Awk
- A Better lastlog with Awk
- Using Perl as a Bash Scripting Alternative
- Using Python as a Bash Scripting Alternative
商品描述(中文翻譯)
關鍵特點
- 確認高層步驟,例如驗證用戶輸入、使用命令行和條件語句來創建和執行簡單的 shell 腳本
- 創建和編輯動態 shell 腳本以管理複雜和重複的任務
- 透過這本實用的逐步指南,了解 Perl 腳本編寫和 Python 編程作為 BASH 腳本的替代方案
書籍描述
Shell 腳本是一種快速原型設計複雜應用程序或問題的方法,通過自動化任務來處理基於 Linux 的系統。使用簡單的一行命令和命令序列,可以輕鬆解決從文本處理到備份系統管理工具的複雜問題。
在這本書中,您將發現掌握 shell 腳本所需的所有知識,並對您使用的元素做出明智的選擇。了解在正常模式和調試模式下創建和運行腳本的基本原則。學習各種條件語句的代碼片段,並認識到重複和循環在您的 shell 腳本中的強大功能。實現函數並使用流編輯器編輯文件,使用 Perl 腳本編寫,使用 Python 編程,以及全面涵蓋其他腳本語言,以確保您能選擇最適合您項目的工具。
您將學到的內容
- 使用 type 命令來識別命令評估的順序
- 創建提示用戶輸入的互動式腳本
- 為對命令行經驗不多的操作員建立菜單結構
- 開發動態編輯網頁配置文件以生成新虛擬主機的腳本
- 編寫使用 AWK 搜索和報告日誌文件的腳本
- 使用函數作為構建塊來編寫有效的腳本,減少維護和構建時間
- 通過比較 Perl 和 Python 與 BASH 等不同腳本語言來做出明智的選擇
關於作者
**Andrew Mallett** 是 The Urban Penguin 的擁有者,並且是專業 Linux 軟體開發、培訓和服務的全面提供者。作為一名命令行愛好者,他認為通過了解命令行快捷鍵和腳本編寫可以節省大量時間。由 Andrew 維護的 TheUrbanPenguin YouTube 頻道擁有超過 800 部視頻來支持這一點,他還撰寫了四本其他的 Packt 書籍。
目錄
1. BASH 腳本的什麼和為什麼
2. 創建互動式腳本
3. 附加條件
4. 創建代碼片段
5. 替代語法
6. 使用循環進行迭代
7. 使用函數創建構建塊
8. 介紹 sed
9. 自動化 Apache 虛擬主機
10. AWK 基礎
11. 使用 AWK 總結日誌
12. 使用 AWK 改進 lastlog
13. 使用 Perl 作為 BASH 腳本的替代方案
14. 使用 Python 作為 BASH 腳本的替代方案