Skip to content

Strict mode options #805

@timbertson

Description

@timbertson

When writing scripts in bash, I always use some combination of:

  • set -e (fail if any command fails)
  • set -u (fail if any undefined variable is referenced)
  • set -x (print each command before it's executed)
  • set -o pipefail (a failed command in a pipeline will cause the parent command to fail)

Additionally, it would be nice to have an option like pipefail that applies to subshells (i.e causes echo (false) to return nonzero status).

It doesn't seem like any of these are available in fish, which doesn't usually matter for interactive use but kills it as a scripting language for me (which is a shame, because fish's sensible variable-expansion would make it much harder to accidentally get quoting wrong).

Any chance of adding similar features?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions