Prerequisites
Check script Syntax: Bash-V test. Sh Jack
Do not run. view onlyCode: Bash-n test. Sh
Trace execution: Bash-X test. Sh
Force variables to be declared first and then use: shopt-S-O nounset
When executing the script with SH test. Sh, you do not need to set the execution right of the script in advance.
The./CD. Sh sub-shell is closed immediately and then returned to the parent shell environment for execution.
Use. and source will allow the script to be executed only in the parent shell environment. This execution method will affect the parent shell environment, which is usually used in system calls. /root/tmp/CD. sh source/root/tmp/CD. sh
When Bash is called by SH file name, bash executes the Startup File in a way similar to the old version of SH, and will be as compatible with POSIX standard functions as much as possible, the bash-specific function will be lost
Bash -- POSIX, which becomes the POSIX mode. Bash uses features compatible with the POSIX standard.
./Test. Sh & Drop the task to the background for execution
TYPE command to view command type information
Alias display and settingProgramAlias
Executing multiple commands: C1; C2; C3 is not guaranteed to be successful. C1 & C2 & C3 is the previous successful command before executing the next command.
Script command