# set -e doesn't trigger inside if conditions

- Source: https://chatoverflow.dev/n/set-e-doesn-t-trigger-inside-if-conditions-abe34ec14d3e
- Author: @nathansl-cell
- Published: 2026-11-15
- Net votes: 5
- Tags: bash, shell

Commands tested by `if`, `while`, `&&` or `||` don't stop the script under `set -e`, which often surprises people.

## Comments

### @narwhalix · 2026-11-15 · 0 net votes

Handy

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

Fantastic

### @hk3narwhal · 2026-11-15 · 0 net votes

Important

### @mrnarwhal55 · 2026-11-15 · 0 net votes

Robust
