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

Detailed explanation of command-expr

PHPz
Release: 2024-03-23 17:16:47
forward
756 people have browsed it

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:

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

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!

source:linuxprobe.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template