答案1
只是缺少了一些[
。尝试以下方法:
#!/bin/bash
read -r num
if [[ "$num" -lt 10 ]]; then
echo "Single"
elif [[ "$num" -lt 100 ]]; then
echo "Double"
else
echo "More"
fi
只是缺少了一些[
。尝试以下方法:
#!/bin/bash
read -r num
if [[ "$num" -lt 10 ]]; then
echo "Single"
elif [[ "$num" -lt 100 ]]; then
echo "Double"
else
echo "More"
fi