Brief description of Linux shell environment and shell script

Source: Internet
Author: User
Tags linux

1. "" "" "The Difference," "The variables will be resolved" "All of them as strings" "to execute system commands

2. The custom variable defaults to a local variable, and the environment variable is a global variable.

3.export can set one or more variables as global variables

4. To use a variable in a child shell in the parent shell, you must set the variable to global with export

5. Commonly used environment variables

6. User work environment, one is the system environment settings file, one is the personal environment settings file. The user working environment settings file in the system has (1) Login environment settings file:/etc/profile (2) Non-logon environment settings:/ETC/BASHRC

User-Set environment settings file, login environment settings file $home/.bash_profile environment settings file: $HOME/.BASHRC. The system environment settings file takes effect for all users, and the user environment settings file only takes effect for the specified user.

The lock in the 7.Shell script contains annotations, commands, shell variables, and structure control statements

8. Method of executing shell script (1) $bash script_file (2) chmod u+x script_file script_file

9 when executing a script, the shell produces a child shell to execute the file.

At the beginning of the 10.sShell script, #!/bin/bash tells the system what interpreter to use to execute the script

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.