shell编程写了一个case嵌套if和for的语句,一直报错,求大虾指教
case$1inJanuary|1)if[$2="-"];then{for((i=$1;i<=$3;i++));docali$4done};elsecal$1$2fi;;...
case $1 in
January|1) if[$2 = "-"];then
{ for((i=$1;i<=$3;i++));
do
cal i $4
done
};
else cal $1 $2
fi
;;
如上,报错 Syntax error: "then" unexpected (expecting ";;"),不知道哪里错了,求大虾指导 展开
January|1) if[$2 = "-"];then
{ for((i=$1;i<=$3;i++));
do
cal i $4
done
};
else cal $1 $2
fi
;;
如上,报错 Syntax error: "then" unexpected (expecting ";;"),不知道哪里错了,求大虾指导 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询