return
Finish executing the enclosing user-defined command without executing any more of its statements.
command do_the_observations() { if(!$signaled(quit)) { track Jupiter until $aquired(source) | $signaled(quit) if(!$signaled(quit)) { noise_cal on until $elapsed > 10s | $signaled(quit) if(!$signaled(quit)) { offset dk=-90 } } } }This can be avoided by using the return command, to terminate the command early. This would be done by rewriting the above command as follows.
command do_the_observations() { if($signaled(quit)) { return } track Jupiter until $aquired(source) | $signaled(quit) if($signaled(quit)) { return } noise_cal on until $elapsed > 10s | $signaled(quit) if($signaled(quit)) { return } offset dk=-90 }
return
command is generally used to avoid
having to have too many nested if
statements within a command.
It immediately terminates the execution of the enclosing
user-defined command. If it is called outside of a command
definition, it terminates the whole script.