当前位置:网站首页>09 expr 命令
09 expr 命令
2022-07-26 21:15:00 【蓝风9】
前言
呵呵 这个命令 应该是 linux 使用者 基本上都会使用到的吧?
呵呵 我们这里主要是 看一下 这个命令是如何工作的
main 中主要是参数处理, 然后将核心业务委托给 eval
eval 主要是委托业务给 eval1 - eval7 来处理, 分别是 由优先级的从低到高
这就是一个 自己从 0 开始的 eval 的一个实现, 呵呵 很经典
我之前有一个自己的 EvalLike, 实现相对简单 02 计算字符串表达式 [类似于js eval函数]_970655147的专栏-CSDN博客_js 字符串表达式
基于 linux-4.4.0 + coreutils-8.25
调试基于命令 "expr 2 + 3"
main
参数处理, 然后将核心业务委托给 eval

eval
首先是 | 的处理
eval1 是 & 的处理
eval2 是 <, >, <=, >=, ==, != 的处理
eval3 是 +, - 的处理
eval4 是 *, /, % 的处理
eval5 是 : 的处理
eval6 是 length, match, index, substr 的处理
eval7 是 () 的处理

我们这里的 2 + 3 的处理

完
边栏推荐
- JDBC summary
- Uncover the secrets of Xiaomi 100million pixel camera: 1/1.3 inch COMS sensor, resolution 12032 × nine thousand and twenty-four
- Afnetworking understand
- Highlight the secondary and tertiary columns under the primary column of pbootcms
- 吃透负载均衡
- If you do not add waitkey() function after imshow() function, it will not be displayed
- Shrimp Shope gets the product details API according to the ID
- Happens-Before原则深入解读
- 七、微信小程序运行报错:Error: AppID 不合法,invalid appid
- Jd.com: how does redis realize inventory deduction? How to prevent goods from being oversold?
猜你喜欢

Vi和Vim文本编辑器

Selenium自动化测试面试题全家桶

Flink's real-time data analysis practice in iFLYTEK AI marketing business

Pytoch uses RNN model to build person name classifier

VI and VIM text editors

imshow()函数后面如果不加waitKey()函数就不显示

技术分享 | 服务端接口自动化测试, Requests 库的这些功能你了解吗?

Let me show you the MySQL isolation level. What happens when two transactions operate on the same row of data at the same time?

FreeRTOS personal notes - Software Timer

matlab 激励模型 三角波频谱
随机推荐
Go----Go 语言命名规范
Use of cmake
Basic operation of (C language) files
matlab 激励模型 三角波频谱
Highlight the secondary and tertiary columns under the primary column of pbootcms
华为发布2025十大趋势:5G、机器人、AI等上榜
成功上岸了自动化测试岗,最高月薪15.4K,自己真棒~
matlab 短时自相关实现
测试员:“我有五年测试经验”HR: “不,你只是把一年的工作经验用了五年”
OPPO 自研大规模知识图谱及其在数智工程中的应用
Just one dependency to give swagger a new skin, which is simple and cool
Pytoch uses RNN model to build person name classifier
仅需一个依赖给Swagger换上新皮肤,既简单又炫酷
day07-
深入源码剖析String类为什么不可变?(还不明白就来打我)
Isilon 的OneFs常见操作命令(一)
Japan approves the export of EUV photoresist to South Korea, and the crisis of Samsung and SK Hynix may be alleviated
虾皮shopee根据ID取商品详情 API
Samsung releases 108million pixel image sensor isocell bright HMX, and Xiaomi will launch
Altium Designer 22 中文字符乱码