Koskamo

Shell options with set

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

The set builtin changes the values of shell options, sets the positional parameters, or, with no options or arguments, displays the names and values of all shell variables and functions in a format reusable as input. set -e exits immediately if a pipeline, list, or compound command returns a non-zero status; the shell does not exit when the failing command is part of a while or until condition, part of an if test, any command in a && or || list except the one following the final operator, any command in a pipeline but the last (subject to pipefail), or a command whose status is inverted with !, and a trap on ERR, if set, is executed before the shell exits. set -u treats expanding unset variables as an error, and a non-interactive shell exits. set -x prints commands to standard error after expansion and before execution, prefixed by the expanded PS4. pipefail, disabled by default, makes a pipeline return the rightmost non-zero status. set -C (noclobber) stops > from overwriting existing files; >| overrides it. set -o prints the current option settings. Scope: Bash. Reviewed October 4, 2026.

Source and provenance

Original source
www.gnu.org
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.