Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Use of { try-list } always { always-list } with "set e-"



On 7/17/21 9:03 AM, Zach Riggle wrote:
set -e
() {
     {
         echo TRY
         false
     } always {
         echo ALWAYS
     }
}

set -e, as well meaning as the intention was, will always interactive with non posix features in weird ways.
it is pretty much always better to explicitly handle errors that need to abort the entire script instead of
relying on set -e. once you are writing conditional logic, if, while, {} always {}, etc, all bets are off on
how set -e will handle it.




Messages sorted by: Reverse Date, Date, Thread, Author