Simple Linux Command Line notes: expr

Source: Internet
Author: User
ArticleDirectory
    • Parameters
    • Example
    • Tips

Calculate the expression value

ExprExpression

 

Expr is used to calculate the value of an expression and send the calculation result to the standard output.

 

Parameters

: Comparison operator

* Multiplication number

/Division number

% Modulo operator

+ Plus sign

-Minus sign

<Yu no.

<= Less than or equal to No.

= OR = equal

! = Not equal

> = Greater than or equal

> Yu ID

& And (and) Operations

| Or (OR) Operation

 

Example
 
$Expr 5*420$Expr 44+549$Expr 45/59$ExprSam =Sam1

 

Tips

1. Numbers and operators must be separated by spaces.

2. When the comparison operation is performed, the true value is 1, and the false value is 0.

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.