And the control variable value range (f)

Double quotes with single quotes
● "String ..."
- allow $ expand in double quotes, you can call the values of other variables
- where special characters, can be \ escaped symbols
- when the variable value does not include space, tab, when character, double quotes are generally omitted
● '... string'
- All characters are treated as the character itself (no special meaning)
- allowed \ escape

Assignment using double quotation marks
● A variable B is assigned to the variable
And the control variable value range (f)
when ● spaces, can not be omitted quotes
And the control variable value range (f)

Use single quotes assignment
● With the use of special characters, save
And the control variable value range (f)

read read value of the variable usage
● Basic format
-read the variable name ...
-read -p "message" variable name (easy to add custom interactions)
And the control variable value range (f)

Default values
● Start read command -s option
- close the input echo (from the keyboard input information is not displayed on the screen)
- suitable for reading sensitive information, improve safety
And the control variable value range (f)

Scope variables
● Local variables
- This variable is defined only in the current environment effectively Shell
- default custom variables are local variables
● Global variables
- are effective in the current Shell and Shell environment for all children
- the child if the assignment in Shell variable of the same name, has nothing to do with the variables in the parent Shell

Posted global variables
● export the local variable name [= variable value] ...
- Direct-defined variables / assigning designated as global variables
- the existing local variables, just released without assignment
And the control variable value range (f)

Cancel All variables
● export -n global variable name ...
- Cancellation of the global variable properties
- this is moot local Bin Liang
And the control variable value range (f)

Guess you like

Origin blog.51cto.com/14449563/2425423