I've been getting the error: line 9: * 12: syntax error: operand expected (error token is "* 12") (I entered 3, 4, 1 as a test on the script) the result that I need still shows at the end but after this error line. Why is that line showing if everything "works"?
Here's my code so you can understand what I did:
y='1'
z='0'
while [ $z = 0 ]
do
read x
if [[ "$x" -ge "0" ]];
then
y=$[$x*$y]
fi
done
echo -n "The multiplication of positive numbers entered is: $y"
exit
Aucun commentaire:
Enregistrer un commentaire