- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 373
 
Open
Labels
Description
Extract from the 4.2.0 release notes (released on 19 March 2004):
A new try block and always block syntax has been introduced to make it easier
to ensure the shell runs important tidy-up code in the event of an error. It
also runs after a break, continue, or return, including a return forced by the
ERR_RETURN option (but not an exit, which is immediate). The syntax is:
{ try-block-list } always { always-block-list }where no newline or semicolon may appear between
}andalways. [...]Source: https://zsh.sourceforge.io/releases.html#:~:text=Changes%20since%20zsh%20version%204.2.0
{
  command_that_might_fail
} always {
  echo "This code is always executed."
}