abs icon indicating copy to clipboard operation
abs copied to clipboard

Bash腳本進階學習 - 深入探索shell scripting之藝術

Bash腳本進階學習 - 深入探索shell scripting之藝術

作者:Mendel Cooper; Email:[email protected]
譯者:KunYu Chen, FangWei Wang, Chih-Che Chang, Bo-Jun Fang, Goldie Lin, Hao-Ting

This tutorial assumes no previous knowledge of scripting or programming, yet progresses rapidly toward an intermediate/advanced level of instruction . . . all the while sneaking in little nuggets of UNIX® wisdom and lore.

  • [x] 本書涵蓋範圍包含shell scripting初級(無程式設計或腳本撰寫相關經驗的人皆可看懂)中級與高級知識,並從中帶領讀者淺嚐UNIX®的知識及智慧。

It serves as a textbook, a manual for self-study, and as a reference and source of knowledge on shell scripting techniques.

本教材可視為教科書、自學手冊或學習shell scripting技術之參考文獻。

The exercises and heavily-commented examples invite active reader participation, under the premise that the only way to really learn scripting is to write scripts.

本書提供練習題與含有大量註解的範例,希望能讓讀者有更多動手實做的機會。因為要真正學好scripting,就是得實際動手寫。

This book is suitable for classroom use as a general introduction to programming concepts. This document is herewith granted to the Public Domain. No copyright!

本書適用於一般教授「程式設計概論」之課堂。這本書是寫給社會大眾的。因此,不用擔心版權問題。因為本書,無版權!


For Anita, the source of all the magic
本書獻給Anita,妳是驅使這本書完成的動力來源。

目錄

  • Part 1. 引言

    • 1 Shell 程式設計!
    • 2 從 Sha-bang (#!) 入門
    • 2.1 執行腳本
    • 2.2 初步練習
  • Part 2. 基礎篇

    • 3 特殊符號
    • 4 變數與參數簡介
    • 4.1 變數替換
    • 4.2 變數值
    • 4.3 Bash 變數是沒有特定類型的
    • 4.4 特殊的變數型態
    • 5 引號使用
    • 5.1 引用變數
    • 5.2 跳脫
    • 6 退出及退出狀態
    • 7 測試
    • 7.1 測試結構
    • 7.2 檔案測試運算子
    • 8 運算元、運算子及其他相關主題
    • 8.1 運算子
    • 8.2 數字常數
    • 8.3 雙小括號結構
    • 8.4 運算子優先權
  • Part 3. 進階篇

    • 9 再論變數
    • 9.1 內部變數
    • 9.2 變數型態:宣告與設定
    • 9.3 $RAMDOM: 產生隨機變數
    • 10 操弄變數
    • 10.1 操弄字串
    • 11 迴圈(Loops)與分流(Branches)
    • 11.1 迴圈
    • 12 指令替換
    • 13 算術擴展
    • 14 課間休息
  • Part 4. 指令

    • 15 Internal Commands and Builtins
    • 16 External Filters, Programs and Commands
    • 17 System and Administrative Commands
  • Part 5. 進階課題

    • 18 Regular Expressions
    • 19 Here Documents
    • 20 I/O Redirection
    • 21 Subshells
    • 22 Restricted Shells
    • 23 Process Substitution
    • 24 Functions
    • 25 Aliases
    • 26 List Constructs
    • 27 Arrays
    • 28 Indirect References
    • 29 /dev and /proc
    • 30 Network Programming
    • 31 Of Zeros and Nulls
    • 32 Debugging
      1. Options
      1. Gotchas
      1. Scripting With Style
      1. Miscellany
      1. Bash, versions 2, 3, and 4
      1. Endnotes
    • 38.1. Author's Note
    • 38.2 About the Author
    • 38.3 Where to Go For Help
    • 38.4 Tools Used to Produce This Book
    • 38.5 Credits
    • 38.6 Disclaimer

    source: http://tldp.org/LDP/abs/html/