fixed shellcheck warnings
This commit is contained in:
parent
1836f04938
commit
269336fcf0
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue