implemented wait
This commit is contained in:
parent
f0153c9627
commit
d02188c6ed
11
demo.sh
11
demo.sh
@ -1,7 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
TYPE_SPEED="${TYPE_SPEED:-15}"
|
TYPE_SPEED="${TYPE_SPEED:-15}"
|
||||||
PROMPT_TIMEOUT="${PROMPT_TIMEOUT:-0}"
|
PROMPT_TIMEOUT="${PROMPT_TIMEOUT:--1}"
|
||||||
|
|
||||||
function simtyping()
|
function simtyping()
|
||||||
{ pv -qL $(($TYPE_SPEED+$((-2 + RANDOM%5)))); }
|
{ pv -qL $(($TYPE_SPEED+$((-2 + RANDOM%5)))); }
|
||||||
|
|
||||||
|
function wait()
|
||||||
|
{
|
||||||
|
if [ "$PROMPT_TIMEOUT" == "-1" ]; then
|
||||||
|
read -rs
|
||||||
|
else
|
||||||
|
read -rst "$PROMPT_TIMEOUT"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user