variable

TMOUT

A positive value supplies the default read timeout when -t is absent, also affects select and interactive prompt inactivity. A timed-out read returns a nonzero status greater than 128. This bounded fixture tests read only, not terminal auto-logout. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): read timed out.

Formal Syntax & Structure

bash syntaxbash
TMOUT

Return Value

shell variable

Expansion yields the current value; it has no independent command exit status.

Working Example

Example Snippetbash
TMOUT=1if IFS= read -r value < <(sleep 1.3; printf 'late\n'); then    exit 1else    rc=$?    (( rc > 128 )) || exit 1    printf 'read timed out\n'fiwait
Bash Reference