Mastering Linux Shell Scripting Paperback – January 6, 2016

Andrew Mallett

  • 出版商: Packt Publishing
  • 出版日期: 2015-12-24
  • 售價: $1,610
  • 貴賓價: 9.5$1,530
  • 語言: 英文
  • 頁數: 198
  • 裝訂: Paperback
  • ISBN: 1784396974
  • ISBN-13: 9781784396978
  • 相關分類: LinuxCommand 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

  1. What and Why of Scripting with Bash
  2. Creating Interactive Scripts
  3. Conditions Attached
  4. Creating Code Snippets
  5. Alternative Syntax
  6. Iterating with Loops
  7. Creating Building Blocks with Functions
  8. Introducing sed
  9. Automating Apache Virtual Hosts
  10. Awk Fundamentals
  11. Summarizing Logs with Awk
  12. A Better lastlog with Awk
  13. Using Perl as a Bash Scripting Alternative
  14. Using Python as a Bash Scripting Alternative

商品描述(中文翻譯)

主要特點



  • 識別高層次步驟,例如驗證使用者輸入、使用命令行和條件語句來創建和執行簡單的shell腳本

  • 創建和編輯動態shell腳本,以管理複雜和重複的任務

  • 通過這本實用的、逐步指南,了解Perl腳本和Python編程作為BASH腳本的替代方案

書籍描述


Shell腳本是在Linux系統上工作時,通過自動化任務來快速原型化複雜應用程序或問題的一種快速方法。使用簡單的單行命令和命令序列,可以輕鬆解決從文本處理到備份系統管理工具等複雜問題。


在這本書中,您將發現一切您需要了解的內容,以精通shell腳本並對您使用的元素做出明智的選擇。熟悉在正常模式和調試模式下創建和運行腳本的基礎知識。了解各種條件語句的代碼片段,並意識到在shell腳本中重複和循環的力量。使用流編輯器實現功能和編輯文件,使用Perl腳本,使用Python編程-以及對其他腳本語言的全面覆蓋,以確保您可以選擇最適合您項目的最佳工具。

您將學到什麼



  • 使用type命令識別命令評估的順序

  • 創建提示用戶輸入的交互式腳本

  • 為具有少量命令行經驗的操作員建立菜單結構

  • 開發動態編輯Web配置文件以生成新的虛擬主機的腳本

  • 編寫使用AWK搜索和報告日誌文件的腳本

  • 使用函數作為構建塊起草有效的腳本,減少維護和構建時間

  • 通過比較Perl和Python等不同的腳本語言,做出明智的選擇

關於作者


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腳本的替代方案