# Strict Mode

*noun*

say it: **“STRIKT MOHD”** **/ˈstrɪkt ˈmoʊd/**

A line at the top of a bash script that makes it stop at the first failing command, unset variable or failed pipe.

## What is **strict mode** in a bash script?

**Strict mode** is the line `set -euo pipefail` near the top of a script. `-e` stops at the first command that fails, `-u` makes a misspelled or never-set variable an error, and `-o pipefail` fails a pipeline when any part fails. Keep it in scripts, not at the prompt.

```bash
#!/usr/bin/env bash
set -euo pipefail
photo_dir=photos
ls "$photo_dri/"   # ./where.sh: line 4: photo_dri: unbound variable
```

## In a sentence

- “With **strict mode** on, the misspelled photo_dri stopped the script instead of listing the whole computer.”
- “Sam starts every script with **strict mode**, the line set -euo pipefail.”

Level: Freelancer · [More Unix terms at this level](https://www.ask-codey.com/glossary?category=unix&level=4)

Updated: November 10, 2026

## In other subjects

- [Strict Mode in JavaScript](https://www.ask-codey.com/glossary/strict-mode)

Source: https://www.ask-codey.com/glossary/strict-mode-unix
