The variables are divided into 2 types: 1 system Variable 2: User-defined variable
env Display system variable set display system variables and user-defined variables
Custom variable rule: a=1 = number cannot have spaces on either side
Can only consist of numbers, letters and underscores, and cannot start with a number (such as 2a=1)
and avoid using system commands or keywords (e.g., ls if done)
Single quotes (e.g. b= ' ls/etc ') are required when there are special symbols in a custom variable
No single quotes will be error, special symbols have/spaces * #, etc.
When stacking variables, it is best to use double quotes "" (e.g. b= "$a" 113)
Because of the shell's nature, it can exist many child processes, so custom variables are only valid in the current environment. If you need a child process to take effect, you need to declare the custom variable in the shell so that it takes effect globally.
Custom variable Global effective vim/etc/profile recommended to write under/etc/profile.d/
Delete Custom variable unset b then echo$b no result
1.2-shell variable