From 50f446b77204988677658b128ee51209e4bc6987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sun, 8 Oct 2017 21:10:56 +0200 Subject: [PATCH] refactored if fi to && || in wait function --- demo.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/demo.sh b/demo.sh index 9e9794a..e19a003 100644 --- a/demo.sh +++ b/demo.sh @@ -8,11 +8,9 @@ function simtyping() function wait() { - if [ "$PROMPT_TIMEOUT" == "-1" ]; then - read -rs - else + [ "$PROMPT_TIMEOUT" == "-1" ] && + read -rs || read -rst "$PROMPT_TIMEOUT" - fi } function type()