Feature Description: Sets or displays environment variables. Syntax: Export [-fnp][variable name]=[variable setting value] Parameters -F represents the function name in [variable name]. -n Deletes the specified variable. The variables are not actually deleted, but are not exported to the execution environment of the subsequent directives. -p lists all the environment variables that the shell assigns to the program Attention: 1, the script is executed in a child shell environment run, the script after the execution of the child shell automatically exit; 2. The system environment variables in a shell are copied to the child shell (variables defined with export); 3. A system environment variable in a shell is valid only for the shell or its child shell, and the shell ends with the variable disappearing (and cannot be returned to the parent shell). 4. Variables defined without export are valid only for the shell, and the child shell is not valid. Additional notes: 1. When executing a program in the shell, the shell provides a set of environment variables. Export can add, modify, or delete environment variables for use by subsequent executing programs. The effect of export only extends to the operation of this landing. 2. Export creates its own parameters as an environment variable that can be seen by other scripts and programs called by the current program The exported variable forms the environment variable of any child process derived from the shell |