相关疑难解决方法(0)

语法错误:操作数预期(错误标记为"+")

我正在用bash编写脚本,我收到此错误:

./P4.1: line 10: +: syntax error: operand expected (error token is "+")
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

#!/bin/bash
read string
echo $string >| temp
num1= cut -d" " -f1 temp
num2= cut -d" " -f2 temp
num3= cut -d" " -f3 temp
while [ $num1 -gt $num3 ]
do
        echo $num1
        num1=$[$num1+$num2]
done
Run Code Online (Sandbox Code Playgroud)

怎么了,怎么解决?谢谢.

unix bash

11
推荐指数
2
解决办法
7万
查看次数

标签 统计

bash ×1

unix ×1