Linux let command

Source: Internet
Author: User

Command: Let

The Let command is a tool for calculations in BASH that executes one or more expressions and does not need to be added as a variable in the calculation of variables. If a space or other special character is included in an expression, it must be caused.

Syntax format
Let[...] 
Parameter description:

ARG: An expression to execute

Instance:

Self-add operation: letno++

Self-subtraction operation: letno--

Abbreviated form let no+=10,let no-=20, respectively, is equivalent to let no=no+10,let no=no-20.

The following example calculates a and B two expressions and outputs the result:

#!/bin/bash let a=5+4let b=9-3 echo $a $b  

The result of the above instance execution is:

96

Linux let command

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.