Linux--shell programming (programming syntax)

Source: Internet
Author: User

Directory
  1. Re-recognize variables
  2. Function
  3. Conditional statements
  4. Looping statements
1. Re-identification of variables

There are 3 types of variables in the Shell: User variables, positional variables, environment variables

User Variables

User variables are variables that users define in the shell programming process, and are divided into global variables and local variables. By default, a user-defined variable is a global variable, and if you want to specify a local variable, you need to use the local qualifier

1) Special symbols in the Shell:

A list of special characters is as follows:

~ Home directory, quite with $home

' Command replacement, such as Echo ' pwd '

# Script Comments

$ variable expression symbol

& Background Job, place this symbol at the end of the command and let the command run in the background

* Wildcard characters for strings

() (Start child shell) Stop child shell

\ escapes the next character

| Pipeline

[] [Start character set wildcard symbol] End Character Set wildcard symbol

{} {Start command block} END command block

; Shell command delimiter

' Strong references and weak references

> < output redirection and input redirection

/Path Name Directory separator

? Single arbitrary character

! Pipe line Logic not

2) string operator

Positional variables

T

Environment Variables

T

2. Functions

T

3. Conditional Statements

T

4. Circular statements

T

Linux--shell programming (programming syntax)

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.