implemented wait

This commit is contained in:
Kjistóf 2017-10-08 02:57:44 +02:00
parent f0153c9627
commit d02188c6ed
1 changed files with 10 additions and 1 deletions

11
demo.sh
View File

@ -1,7 +1,16 @@
#!/usr/bin/env bash
TYPE_SPEED="${TYPE_SPEED:-15}"
PROMPT_TIMEOUT="${PROMPT_TIMEOUT:-0}"
PROMPT_TIMEOUT="${PROMPT_TIMEOUT:--1}"
function simtyping()
{ pv -qL $(($TYPE_SPEED+$((-2 + RANDOM%5)))); }
function wait()
{
if [ "$PROMPT_TIMEOUT" == "-1" ]; then
read -rs
else
read -rst "$PROMPT_TIMEOUT"
fi
}