ABS

Shell: A command interpreter on Linux, also, it is a powerful programming language. A shell program is an eay to use tool for building applications by gluing together system calls, tools, utilities, and compiled binaries.

A shell script is a quick-and-dirty method of prototyping a complex application. the structure of the application can be tested and tinkered with, and the major pitfalls found before proceeding to the final coding in C, C++, Java, Perl, or Python.

No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes

1. start with a #!/bin/bash --this list the program used to run the script

2. chmod u+x script -- add execute permission to the script

3. ./script to run the script -- must add . as the current directory is not in search path by default

4. there are a lot of special characters in bash, this characters have meta-meanings beyond its literal meaning, examples include #, [, ",', etc

The first thing in any language is variable and parameters. A variable is a label, a name assigned to a location in computer memory that holding the data.

Retrieving the value of a variable is called variable substitution. If variable1 is the name of a variable, $variable1 is the reference to its value.

原文地址:https://www.cnblogs.com/littledot/p/3517446.html