0
ループ制御を試みています。 whileループとwhileループの場合は、ifループの3つが満たされればforループを終了し、whileループを続ける必要がある場合はifループを終了してforループの繰り返しを続行します。現在のループから切断するループ制御
LIMIT=100
while [ "count" -le "$LIMIT" ]
do
for i in 1 2 3 4 5
do
var a
var b
var c
var d
if [ $d -eq 1 ] && [ $a == Done ] && [ $b -eq 0 ]
then
echo "$c" | tr '\n' '\t'
echo "Successful"
break 2 # Need to exit entire for loop
elif [ $d -eq 0 ] && [ $a == Done ] && [ $b -eq 0 ]
then
break # Need to go to next iteration of for
elif [ $a == Active ]
then
echo "Active" # Need to exit entire for loop
break 2
elif [ $d -eq 1 ] && [ $a == Done ] && [ $b -gt 0 ]
then
echo "Fail" # Need to exit entire for loop
break 2
elif [ $a == Queued ]
then
echo "Queued" # Need to exit entire for loop
break 2
else
echo "Nothing"
fi
done
done
最初にif loopがtrueのときに何らかの理由ですべてを終了します。