我运行一个简单的脚本后得到了这条消息:
第9行:意外令牌elif第9行附近的语法错误:elif [$ sales -le 20000];
我的代码:
UIImageView
答案 0 :(得分:4)
then
elif
您可以使用此脚本:
#!/bin/bash
read -p "Please enter the how much sales you have done: " sales
if [ $sales -le 5000 ]; then
pp='0.25'
elif [ $sales -le 10000 ]; then
pp='0.1'
elif [ $sales -le 20000 ]; then
pp='0.15'
elif [ $sales -le 40000 ]; then
pp='0.2'
else
pp='0.25'
fi
echo "your profit is " $(bc -l <<< "$sales * $pp")