Shell script--Symbol Chapter

Source: Internet
Author: User


Shell Execution Script


650) this.width=650; "Width=" 799 "height=" 321 "title=" QQ picture 20160809205710.png "Style=" width:607px;height:229px;float : none; "alt=" Wkiom1ep0pkiz2v4aac1d9tdasu417.png "src=" http://s4.51cto.com/wyfs02/M02/85/9B/ Wkiom1ep0pkiz2v4aac1d9tdasu417.png "/>


650) this.width=650; "title=" QQ picture 20160809212237.png "alt=" wkiom1ep2igxpi3maabpvobgyic455.png "src="/http S2.51cto.com/wyfs02/m01/85/9c/wkiom1ep2igxpi3maabpvobgyic455.png "/>



650) this.width=650; "title=" QQ picture 20160809211211.png "style=" Float:none; "alt=" Wkiol1ep1hzwwsidaaaq03yhbls384.png " src= "Http://s5.51cto.com/wyfs02/M00/85/9B/wKioL1ep1hzwwSIdAAAQ03yhBLs384.png"/>



650) this.width=650; "Width=" 813 "height=" 283 "title=" qq picture 20160809213711.png "style=" WIDTH:669PX;HEIGHT:236PX; "alt= "Wkiol1ep2_ghtyowaadin6ew7ci265.png" src= "Http://s3.51cto.com/wyfs02/M02/85/9B/wKioL1ep2_GhtYOWAADIn6eW7CI265.png"/>

Shell is a batch language (batch tasks are processed one time)

The shell writes the text file, cannot let the operating system run it, but fork creates the child process, the subroutine replaces the shell interpreter, then passes the text file as the command line argument to the Bash interpreter, the child process one line reads the command, encounters a row to create a child process, So executing the above script is equivalent to executing the program.



Shell variables

650) this.width=650; "Width=" 694 "height=" 223 "title=" QQ picture 20160809214920.png "style=" WIDTH:658PX;HEIGHT:216PX; "alt= "Wkiom1ep3t-xawboaacvdp7nwkc792.png" src= "Http://s1.51cto.com/wyfs02/M02/85/9C/wKiom1ep3t-xAwBOAACVdp7NWkc792.png"/>


env Display Environment variables

Export imports local variables into environment variables

Set display environment variables and local variables

unset delete a defined local variable and environment variable

Variable reference


650) this.width=650; "title=" QQ picture 20160809220508.png "alt=" wkiol1ep4nmwm5saaabx6cy3bhw814.png "src="/http S2.51cto.com/wyfs02/m01/85/9b/wkiol1ep4nmwm5saaabx6cy3bhw814.png "/>

The shell variable does not need to be explicitly defined, and the value of the shell variable is a string ; For example, define VALUE=32, which means

Value is a string of 32, not an integer

The shell variable does not need to be defined before it is used, and if a variable is not defined, the value is an empty string


File name substitution

Wildcard *: matches 0 or more arbitrary characters

? : Matches an arbitrary character

[Several characters]: matches one occurrence of any character in square brackets


Transfer characters \ & single quotes & double quotes

Transfer character \ : Used to remove the special meaning of a single character immediately after it


For example: Create a $ $ file

650) this.width=650; "title=" QQ picture 20160809222129.png "alt=" wkiol1ep5k6almdlaaaz2ppqz4g299.png "src="/http S2.51cto.com/wyfs02/m02/85/9c/wkiol1ep5k6almdlaaaz2ppqz4g299.png "/>


Example: Create a-file and delete-file

650) this.width=650; "title=" QQ picture 20160809222413.png "style=" Float:none; "alt=" Wkiom1ep5yht0p7uaaafwlzon74490.png " src= "Http://s1.51cto.com/wyfs02/M00/85/9C/wKiom1ep5yHT0p7uAAAfwLzOn74490.png"/>

650) this.width=650; "title=" QQ picture 20160809222442.png "style=" Float:none; "alt=" Wkiol1ep5yky0xrdaaahjbnoncm898.png " src= "Http://s4.51cto.com/wyfs02/M00/85/9C/wKioL1ep5yKy0xRdAAAhJbNONcM898.png"/>


Single & double quotes: Both the delimiter of the string and not the delimiter of the character


Single quotation marks are used to keep the literal value of all characters within the quotation marks, even if the \ and carriage returns in parentheses are no exception, but no single quotation marks can appear in the string, and if the quotation marks are not paired, the shell will give a continuation prompt asking the user to pair the quotes

650) this.width=650; "title=" QQ picture 20160809223937.png "style=" Float:none; "alt=" Wkiom1ep6sgsb-tzaaaqp-adezi703.png " src= "Http://s3.51cto.com/wyfs02/M01/85/9C/wKiom1ep6sGSb-TzAAAQP-adEZI703.png"/>

Double quotation marks are used to keep the literal value of all characters within the quotation marks, even if carriage returns are no exception


650) this.width=650; "title=" QQ picture 20160809224021.png "style=" Float:none; "alt=" Wkiol1ep6slxjtotaaamzcsra08886.png " src= "Http://s5.51cto.com/wyfs02/M01/85/9C/wKioL1ep6sLxjTotAAAMZCSRa08886.png"/>


650) this.width=650; "title=" QQ picture 20160809225750.png "alt=" wkiol1ep7uiqjo-vaaatwqj6bbm455.png "src="/http S1.51cto.com/wyfs02/m00/85/9c/wkiol1ep7uiqjo-vaaatwqj6bbm455.png "/>


Command substitution "or $ ()


"is also a command, the shell executes the command first, and then the output is immediately substituted to the current command line


For example, define a variable to hold the output of the date command:


` `


650) this.width=650; "title=" QQ picture 20160809233503.png "alt=" wkiol1ep94qz0hdtaaan3i9i7j4037.png "src="/http S4.51cto.com/wyfs02/m01/85/9c/wkiol1ep94qz0hdtaaan3i9i7j4037.png "/>

$()


650) this.width=650; "title=" QQ picture 20160809233003.png "alt=" wkiom1ep9mhso6_6aaapsgrybp0502.png "src="/http S2.51cto.com/wyfs02/m02/85/9c/wkiom1ep9mhso6_6aaapsgrybp0502.png "/>


Arithmetic substitution $ ()

650) this.width=650; "title=" QQ picture 20160809233835.png "alt=" wkiom1ep-h6ikykuaaam1dcxbog900.png "src="/http S2.51cto.com/wyfs02/m02/85/9c/wkiom1ep-h6ikykuaaam1dcxbog900.png "/>


Shell script--Symbol Chapter

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.