3
while [condition]
do
for [condition]
do
if [ "$x" > 3 ];then
break
fi
done
if [ "$x" > 3 ];then
continue
fi
done
在上面的腳本中,我必須測試"$x" > 3
兩次。實際上,我第一次測試它,如果它是真的我想逃避while循環並繼續下一個while循環。shell腳本:嵌套循環並繼續
有沒有更簡單的方法,所以我可以使用像continue 2
這樣的東西來逃避外層循環?
爲什麼不使用'繼續2'在內部循環? –
標籤和轉到? :) – alex
是否有繼續2? – user1769686