這兩者是用於for, while, until 等迴圈控制下。break 會跳至done後方執行 ,而continue會跳至done執行,繼續執行迴圈。
 
   
while 
   echo "Please enter data ('done' to exit):"
   read response
do
   if [ "$response" = "done" ]
   then 
      break 
   fi
   if [ "$response" = "" ]
   then 
      continue 
   fi
   _......
   _......
   process data
   _......
   _......
done
Web Page Copyright: 亞洲大學資訊電機學院 連耀南 yaonanlien@asia.edu.tw  break.htm,  Thu Sep 7 16:18:55 CST 2023