Date Created: 2016/02/29
Update on: 2016/02/29
- Shell variables cannot be left blank on both sides of the equals sign, otherwise the shell will mistake the variable name for the command name
- Variables enclosed in double quotes can be replaced with * and? The file name matches the meta-character extension) and the variable extension, and the single quotation marks do not handle the variable.
- The left quotation mark ', which handles a mechanism similar to a double quote, is able to execute the contents of a string as a shell command, and then replace the string with the output.
- Cut: Divides the row into fields, the default qualifier is tab, you can change the qualifier with the-D option, and the-F option specifies which fields the output contains.
- Bash +x: The command will be printed before executing a command.
- The-n option of the echo command eliminates the usual line breaks.
- A command-line argument to a script can be a variable: $ $ for the first, $ $ for the second, and $ for the name (script name) used to invoke the script, $ #为命令行参数的个数, $* for all parameters, none of these 2 are counted as $ A.
- $? succeeded to 0 for the status of the last execution of the command exit. If it is not successful then the other parameter 1-255, called in the script also represents the state in the previous command (will be updated in real time), and when a script exit 100, then the% value becomes 100. The return value of exit can therefore be used to determine the execution state of the script.
Unix/linux System Management Technical Manual study notes--shell