Hacker News new | ask | show | jobs
by cjvirtucio 1042 days ago
you could also just write as if you're writing go:

function main {

  if ! failing_cmd; then
    log "this fails!"
    return 1
  fi

  log "this won't log"
}

main

I only mention this because there are folks who don't like set -e.