Why can environment variable data be referenced by the quilt process?

Source: Internet
Author: User

What is a "sub-process? That is to say, in my current shell situation, open another new shell, and the new shell is a sub-process. In general, the custom variables of the parent process cannot be used within the child process. However, after the variables are changed to environment variables through export, they can be applied under sub-processes.

The child process only inherits the environment variables of the parent process. The child process does not inherit the custom variables of the parent process, therefore, the User-Defined variables in your original Bash will disappear after entering the sub-process, until you leave the sub-process and return to the original parent process.

Why can environment variable data be referenced by the quilt process? This is becauseMemory Configuration.

Theoretically:

  • When a shell is started, the operating system allocates a memory block to the shell. The variables in the memory can be used by the sub-process;
  • If the export function is used in the parent process, the content of the custom variable can be written to the memory block (environment variable );
  • When loading another shell (that is, the promoter process leaves the original parent process), the Child shell can import the memory block of the parent shell's environment variable into its own environment variable block.

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.