8.6 Pipe character and job control 8.7/8.8 shell variable 8.9 environment variable configuration file

Source: Internet
Author: User

8.6 Pipe symbol and job control

Pipe symbol | is to give the result of the previous order to the following command.
Using this file for experimentation, Vmstat 1 is a constant display of some state of the system.

Re-testing Jobs BG FG is a feature
Move on. This 2 command tests the Sleep sleep200, which is paused for 1000 seconds and 200 seconds without moving, 1000 seconds and 200 seconds after each automatically restores the command window back, and then tests the jobs BG FG

8.7/8.8 Shell variables

Custom variable, but not the same as the system ring qianjing variable

Set |less can use/a=1 to find
But the Env can't find the a=111 custom variable
The summation of variables
A=1 b=2

Display A2C, this time with single quotation marks is wrong, need to use double quotation marks


Non-global variable, only valid under current terminal

Pstree, check it out.

Run Echo $aming does not take effect, this time exit bash, and then run it, because the energy is saved only in the last bash

To change a non-global variable to a global variable export aming=linux

Now pstree a bash, this global variable takes effect only in the current window, only backwards

To cancel a variable assignment

8.9 environment variable configuration file

There are 2 levels, one is the system level,/etc below, one is the user level of ~, each user home directory has a. bash_profile. BASHRC

The preceding point corresponds to source, which loads the meaning of the configuration file
Profile and BASHRC the difference between the two files: profiles are the user log on when the automatic loading of the file, of course, the profile will automatically call BASHRC, BASHRC is logged on as long as the execution of the script will be BASHRC inside some configuration
PS1 variable

To change W to W, the absolute path can be displayed.

PS1 Add color display

PS2 and PS1 correspondence

Extended
The difference between BASHRC and Bash_profile http://ask.apelearn.com/question/7719
Simple Audit System: http://www.68idc.cn/help/server/linux/2014042190951.html
About the meaning of Prompt_command environment variables http://www.linuxnote.org/prompt_command-environment-variables.html

8.6 Pipe character and job control 8.7/8.8 shell variable 8.9 environment variable configuration file

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.