5

#!/bin/bash
set -e ... Why the fuck were you never the default to begin with!?

Comments
  • 1
    THIS!
    i once lost about one hour because i didn't have extended regexes on >n<
    really frustrating, lemme tell you!
  • 3
    Frankly I'd hate it if this setting was ever default...

    I prefer handling errors on my own. And appending calls with ||true sounds like a fucking pain.

    I prefer checking return code where I need it and allowing it to fail silently where I don't need to care about it.
  • 2
    It gets into a gray area when the error could occur on either side of a Bash pipe.

    curl someApi.json | jq '.DeployVersion'

    You can get a very different set of outputs depending on which failed , curl or jq!
  • 0
    This is the linear version of checked exceptions
  • 0
    @SortOfTested Yes!! Bash with checked exceptions would be a sweet project.
  • 0
    @devphobe That's what pipefail and ${PIPESTATUS[0]} are for.
Add Comment