现在,在您将其标记为重复之前,请理解我确实搜索过此问题并且我已经尝试了所有解决方案但都无效。
我的脚本:
#!/bin/bash
echo "Enter the number 3"
read t1
if [$t1 -eq 3]; then
echo "it is 3"
elif [$t1 > 3]; then
echo "it is greater than 3"
fi
exit 0
我得到的错误是:
./g.sh: line 5: [3: command not found
./g.sh: line 7: [3: command not found
答案1
所需空间 if [ $t1 -eq 3 ]