Parent shell and child Shell

Source: Internet
Author: User

Parentheses

The parentheses structure can force the command to run in the sub-shell. Its basic format is:

(

Command 1

Command 2

...

Command n

)

The N commands in parentheses are run in the sub-shell. After bash version 3, the internal variable bash_subshell is defined. This variable records the layer of the sub-shell..

The sub-shell can only inherit some attributes of the parent shell. However, the sub-shell cannot in turn change the attributes of the parent shell..

The attributes that the sub-shell can inherit from the parent shell are as follows:

Current working directory

Environment Variable

Standard input, standard output, and standard error output

All opened file identifiers

Ignored Signal

The attributes that the sub-shell cannot inherit from the parent shell are summarized as follows:

Shell variables except environment variables and variables defined in the. bashrc File

Unignored Signal Processing

Original

Http://blog.sina.com.cn/s/blog_6bd7d943010152f4.html

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.