The export variable has another terminal failure solution, and the export has another

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.