You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This can be modified to be used in a creative way!
In this example I spawn a 30s delay and, while it is already counting down, do some other things in the meantime that are not related to the delay.
When I'm done doing things, I will wait for the remaining delay time:
delay() {
declare -i i=$1
coproc d {
read -n1 -s -t$i
}
}
delay 30
while [ -v d ]; do
echo "Doing things"
wait
done
You'd also be able to stop the delay prematurely by sending input to the pipe: echo > /dev/fd/${d[1]}