gpt4 book ai didi

linux - 为什么 shell 中的 [$value -lt 10] 会导致找不到命令?

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:28:42 28 4
gpt4 key购买 nike

<分区>

输出 1:

Enter your value: 12
./testscript.sh: line 4: 12: command not found
Your value is more than 10

输出 2:

Enter your value: 5
./testscript.sh: line 4: 12: command not found
Your value is more than 10

我需要知道哪里出了问题。我的 Linux 测试就在明天:(

#!/bin/bash
echo -n "Enter your value: "
read value
if [$value -lt 10]
then
echo "Your value is less than 10"
else
echo "Your value is more than 10"
fi

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com