Linux shell programming ---- judgment + operator

Source: Internet
Author: User

Linux shell programming ---- judgment + operator 1 judgment 1 simple if statement if expression then statement fi if then is in the same line, add "; "2 if/else structure if expression then statement else statement fi 3 if/elif/else structure if expression then statement elif statement else statement fi 4 case structure case variable in value1) statement; value2) statement ;;.......................... *) statement; the variable value variable of the esca case structure is compared with value1, value2, and so on one by one until matching values are found. If no matching value is found, the default value *, each branch ends with a double Semicolon ";". In Linux Shell, Operator 1 includes the following Arithmetic Operators: +,-, *,/, %, ** 2 Arithmetic Operator example result + 3 + 5 8-5-3 2*5*3 15/8/3 2% 8% 3 2 ** 5 ** 3 125 3 Linux Shell the let Command is a built-in operation used to calculate integers, suppose I have defined two integer variables a and B, then I can use the let command to perform the operation, let c = a + B, let c = a-B, and so on. The four-bit operator 1-bit operation is rarely used in Shell, and is usually used for integer operations, bitwise operations are performed on the bitwise in the binary data stream where integers are stored in the memory. Two common bitwise operators are <(left shift),> (right shift ), & (bitwise AND) and so on

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.