end - 結束命令區塊

概要

begin
    [COMMANDS ...]
end
function NAME [OPTIONS]; COMMANDS ...; end
if CONDITION; COMMANDS_TRUE ...; [else; COMMANDS_FALSE ...;] end
switch VALUE; [case [WILDCARD ...]; [COMMANDS ...]; ...] end
while CONDITION; COMMANDS ...; end
for VARNAME in [VALUES ...]; COMMANDS ...; end

描述

The end keyword ends a block of commands started by one of the following commands:

  • begin to start a block of commands

  • function to define a function

  • if, switch to conditionally execute commands

  • while, for to perform commands multiple times

end 關鍵字不會改變目前的結束狀態。相反地,之後的狀態將會是最近一個命令所回傳的狀態。