Directory |
- Re-recognize variables
- Function
- Conditional statements
- Looping statements
|
1. Re-identification of variables
There are 3 types of variables in the Shell: User variables, positional variables, environment variables
User Variables
User variables are variables that users define in the shell programming process, and are divided into global variables and local variables. By default, a user-defined variable is a global variable, and if you want to specify a local variable, you need to use the local qualifier
1) Special symbols in the Shell:
A list of special characters is as follows:
~ Home directory, quite with $home
' Command replacement, such as Echo ' pwd '
# Script Comments
$ variable expression symbol
& Background Job, place this symbol at the end of the command and let the command run in the background
* Wildcard characters for strings
() (Start child shell) Stop child shell
\ escapes the next character
| Pipeline
[] [Start character set wildcard symbol] End Character Set wildcard symbol
{} {Start command block} END command block
; Shell command delimiter
' Strong references and weak references
> < output redirection and input redirection
/Path Name Directory separator
? Single arbitrary character
! Pipe line Logic not
2) string operator
Positional variables
T
Environment Variables
T
2. Functions
T
3. Conditional Statements
T
4. Circular statements
T
Linux--shell programming (programming syntax)