true and false commands

Commands that do nothing except succeed (true, or :) or fail (false).

In more detail

They are useful where the shell needs a command, such as while true for an endless loop. cmd || true ignores a failure on purpose under set -e.

Example

grep -q dragon poem.txt || true

Related terms

Taught in

References