舉報

會員
Bash Quick Start Guide
BashandshellscriptprogrammingiscentraltousingLinux,butithasmanypeculiarpropertiesthatarehardtounderstandandunfamiliartomanyprogrammers,withalotofmisleadingandevenriskyinformationonline.BashQuickStartGuidetacklestheseproblemsheadon,andshowsyouthebestpracticesofshellscriptprogramming.ThisbookteacheseffectiveshellscriptprogrammingwithBash,andisidealforpeoplewhomayhaveuseditscommandlinebutneverreallylearneditindepth.Thisbookwillshowyouhowevensimpleprogrammingconstructsintheshellcanspeedupandautomateanykindofdailycommand-linework.Forpeoplewhoneedtousethecommandlineregularlyintheirdailywork,thisbookprovidespracticaladviceforusingthecommand-lineshellbeyondmerelytypingorcopy-pastingcommandsintotheshell.Readerswilllearntechniquessuitableforautomatingprocessesandcontrollingprocesses,onbothserversandworkstations,whetherforsinglecommandlinesorlongandcomplexscripts.Thebookevenincludesinformationonconfiguringyourownshellenvironmenttosuityourworkflow,andprovidesarunningstartforinterpretingBashscriptswrittenbyothers.
目錄(200章)
倒序
- 封面
- Title Page
- Copyright and Credits
- Bash Quick Start Guide
- Dedication
- Packt Upsell
- Why subscribe?
- Packt.com
- Contributors
- About the author
- About the reviewers
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Download the color images
- Conventions used
- Get in touch
- Reviews
- What is Bash?
- What Bash is and is not
- Getting Bash
- Checking Bash is running
- Switching the login shell to Bash
- Identifying the Bash version number
- Upgrading Bash on macOS X
- Understanding Bash features
- POSIX shell script features
- Bash-specific features
- Do I need Bash?
- Choosing when to apply Bash
- Choosing when to avoid Bash
- Getting help with Bash
- Summary
- Bash Command Structure
- Using Bash interactively
- Interactive key bindings
- Simple commands
- Shell metacharacters
- Quoting
- Escaping
- Single quotes
- Double quotes
- Quote concatenation
- Running commands in sequence
- Exit values
- Stopping a command list on error
- Running a command in the background
- Summary
- Essential Commands
- Distinguishing command types
- Essential Bash builtin commands
- The type command
- The echo command
- The printf command
- The pwd command
- Tilde paths
- The cd command
- Changing the directory in scripts
- The set command
- The declare command
- The test [ and [[ commands
- Essential system commands
- The ls command
- Getting filename lists without ls
- The mv command
- The cp command
- The rm and rmdir commands
- The grep command
- The cut command
- The wc command
- Getting file sizes with wc or du
- The find command
- Executing commands for each result
- A note about find and xargs
- The sort and uniq commands
- Summary
- Input Output and Redirection
- Redirecting output
- Redirection paths
- Avoiding overwrites
- Appending to files
- Understanding created file permissions
- Choosing permissions for created files
- Redirecting errors
- Combining errors with output
- Blocking errors completely
- Sending output to more than one place
- Redirecting input
- Using a long string as input with here-documents
- Using pipes
- Adding file contents to a stream
- Piping output from multiple programs
- Filtering programs
- The sed stream editor
- The AWK programming language
- Summary
- Variables and Patterns
- Using variables
- Listing variables
- Naming variables
- Variable name case
- Clearing variables
- Environment variables
- Calling programs with environment variables
- Expanding variables
- Reading a value into a variable
- Getting command output in variables
- Parameter expansion forms
- Specifying default values
- String chopping
- Extracting substrings
- Getting string length
- Substituting strings
- Changing case
- Combining parameter expansion forms
- Doing math in Bash
- Fixed or floating-point arithmetic
- Using globs
- Configuring globbing behavior
- Including dot files but excluding dot and dot-dot
- Expanding to nothing
- Case-insensitive globbing
- Extended globbing
- Using arrays
- Glob expansion in arrays
- Associative arrays
- Summary
- Loops and Conditionals
- Using the if keyword
- Using the test command
- Using the [ command
- Using the [[ keyword
- Arithmetic conditions
- Switching with the case keyword
- Looping over shell words with for
- Skipping an iteration
- Ending the loop
- Misuse of for loops
- Using Bash's C-style for loops
- Using while loops
- Infinite loops
- Reading data line by line
- Field splitting
- Saving fields into arrays
- Choosing the splitting character
- Disabling whitespace trimming
- Reading process output
- Avoiding subshell problems
- Avoiding input problems with ssh
- Summary
- Scripts Functions and Aliases
- Aliases
- Defining new aliases
- Understanding shortcomings with aliases
- Functions
- Defining functions
- Passing arguments to functions
- Using -- to separate options from filenames
- Getting all the arguments
- Returning values from functions
- Understanding function input and output
- Function scope
- Reloading functions at shell startup
- Scripts
- Scripting methods
- Writing a shebang script
- Finding scripts with $PATH
- System bindir
- User bindir
- Arguments to scripts
- Understanding sh vs bash
- Using env
- Choosing between functions and scripts
- Using functions in scripts
- Summary
- Best Practices
- Quoting correctly
- When you don't want quotes
- Handling filenames starting with dashes
- Separating output and diagnostics
- Keeping scripts brief and simple
- Keeping scripts flexible
- Respecting and applying the user's configuration
- Allowing scripts to run without user input
- Limiting the scope of shell state changes
- Avoiding path anti-patterns
- Avoiding Bash for untrusted user input
- Documenting scripts
- Writing comments
- Providing help output
- Writing manual pages
- Using temporary files cleanly
- Cleaning up after a script
- Tools to check shell scripts for problems
- Summary
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時間:2021-07-23 16:59:26
推薦閱讀
- Seven NoSQL Databases in a Week
- 會聲會影X5視頻剪輯高手速成
- Hands-On Artificial Intelligence on Amazon Web Services
- 基于LabWindows/CVI的虛擬儀器設計與應用
- 大數據專業英語
- 一本書玩轉數據分析(雙色圖解版)
- Getting Started with MariaDB
- Mastering Elastic Stack
- 21天學通C#
- 統計學習理論與方法:R語言版
- Moodle Course Design Best Practices
- 計算機網絡安全
- 工業機器人應用案例集錦
- Natural Language Processing and Computational Linguistics
- 傳感器原理與工程應用
- Hands-On Business Intelligence with Qlik Sense
- PowerPoint 2010幻燈片制作高手速成
- Raspberry Pi 3 Projects for Java Programmers
- 工業機器人與自控系統的集成應用
- 數據庫技術:Access 2003計算機網絡技術
- 嵌入式系統應用開發基礎
- 新手學Photoshop CS6數碼照片處理
- 黑客攻防實戰編程
- Spark MLlib機器學習實踐(第2版)
- 自動化生產線裝配與調試技術-:基于西門子S7-200系列PLC
- 51單片機C語言應用開發三位一體實戰精講
- Implementing Cloud Storage with OpenStack Swift
- Mastering JBoss Drools 6
- 大數據可視化技術
- Predictive Analytics with TensorFlow