fixed shellcheck warnings

This commit is contained in:
Nicolas Roman 2019-02-18 17:37:17 +01:00
parent 1836f04938
commit 269336fcf0
1 changed files with 4 additions and 3 deletions

View File

@ -65,13 +65,14 @@ get_now() {
# timeout on read(), uses TMOUT env as timer
timedout_read() {
if [ -z ${TMOUT+x} ] || [ "$TMOUT" = 0 ]; then
export TMOUT=36000
if [ -z "${TMOUT+x}" ] || [ "$TMOUT" = 0 ]; then
# maximum allowed by stty
export TMOUT=25
fi
user_input=$1
old_tty_settings=$(stty -g)
stty -icanon min 0 time ${TMOUT}0
read $user_input
read -r "$user_input"
stty "$old_tty_settings"
unset TMOUT
}