Home >System Tutorial >LINUX >Detailed explanation of command-expr

Detailed explanation of command-expr

PHPz
PHPzforward
2024-03-23 17:16:47725browse

The expr command is an expression calculation tool, use it to complete the evaluation operation of expressions.

Detailed explanation of command-expr

Common operators for expr:

加法运算:+
减法运算:-
乘法运算:\*
除法运算:/
求摸(取余)运算:%
grammar
expr(选项)(参数)
Options
--help:显示指令的帮助信息;
--version:显示指令版本信息。
parameter
表达式:要求值的表达式。
Example
result=`expr 2 + 3`
result=$(expr $no1 + 5)

The above is the detailed content of Detailed explanation of command-expr. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:linuxprobe.com. If there is any infringement, please contact admin@php.cn delete