The export variable has another terminal failure solution, and the export has another
Sometimes, we need to make an export variable global. Otherwise, each terminal needs to re-export, which is very troublesome.
First, if a variable is directly export, it will only take effect on the current sub-terminal. If another terminal is opened, it will become invalid.
If you modify. bash_profile also has some limitations. This file will only be initialized when the user logs on to the system. If we do not want to restart or log on to the user again during use, therefore, modifying this file will not work out.
Currently, I know that the best way is to modify. bashrc (this file is only for a single user and will not affect other users)
For example, I need to export an ORACLE_SID
I can vi. bashrc (the file is located in the home directory) and add export ORACLE_SID = ORCL at the end of the file
Open another terminal and echo $ ORACLE_SID will also display ORCL