Уничтожить неактивную оболочку Bash

Есть ли способ автоматически отключить консоль Bash после того, как она простаивает в течение определенного периода времени?

0
31.05.2019, 20:36
1 ответ

Я бы предложил установить для переменной TMOUT ненулевое значение. Если пользователи попытаются переопределить его, установите его только для чтения в сценарии глобального профиля.

TMOUT

If set to a value greater than zero, TMOUT is treated as the default timeout for the read builtin (see Bash Builtins). The select command (see Conditional Constructs) terminates if input does not arrive after TMOUT seconds when input is coming from a terminal.

In an interactive shell, the value is interpreted as the number of seconds to wait for a line of input after issuing the primary prompt. Bash terminates after waiting for that number of seconds if a complete line of input does not arrive.

1
28.01.2020, 02:40

Теги

Похожие вопросы