Set/env/export/declare and profile

Source: Internet
Author: User


Finally understand the meaning of set env export declare and profile. Take bash as an example. When linux is started, it will read the/etc/profile file. In fact, this file is a shell script file, so you can define some environment variables in this file. Note: The variables defined in this file are system variables, that is, these variables exist as long as the operating system is started and are irrelevant to whether the user logs on. When each user logs on, linux starts a user logon shell, which reads $ HOME /. profile (or $ HOME /. bashrc) file, so the variables defined in these files are called user variables, which exist only after the user logs on to -www.2cto.com-successfully. Note: Both system variables and user variables can be directly used by logged-on users. The difference is that different users may have different user variables. If you use the set command without parameters, the displayed result is: System variable + User variable without parameters using the env command. The displayed result is: the user variable uses the export command without parameters. The displayed result is: the system variables exported as user variables use the declare command without parameters. The results are the same as those of the set command.
Author f543711700

Related Article

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.