Shell Scripts – Basics and Common Mistakes
摘要
This chapter is not intended to be a tutorial on shell programming but to cover some basic concepts that are useful for beginners to know about and some common mistakes that are often encountered. I strongly recommend that you study the Advanced Bash Scripting Guide and use this chapter as a quick reference only. Here we treat bash syntax as the most common syntax. Most of the constructs will work in shells other than csh/tcsh. I deliberately do not include all shell expressions and do not show all the features of the described constructs, but only the main ones. I highly advise you to learn advanced bash syntax, as it helps you to understand not yours scripts and write efficient bash code.