小编Gen*_*ode的帖子

在busybox sh上做数学运算

我有字符串变量MINSEC(分钟和秒):

MIN="1"
SEC="34"
Run Code Online (Sandbox Code Playgroud)

我想对这些进行计算:

TOTSEC = MIN*60 + SEC
Run Code Online (Sandbox Code Playgroud)

我试过:

expr $SEC + $MIN * 60
Run Code Online (Sandbox Code Playgroud)

结果:

expr: non-numeric argument
Run Code Online (Sandbox Code Playgroud)

让大家知道我运行busybox一个定制的微型计算机,因此无法获得bashbc和其他的解决方案提供。

shell busybox

0
推荐指数
1
解决办法
2460
查看次数

标签 统计

busybox ×1

shell ×1