11 lines
186 B
Bash
11 lines
186 B
Bash
#!/bin/bash
|
|
|
|
#
|
|
# Efficient sleep (does not create a new process).
|
|
#
|
|
snore(){
|
|
local IFS
|
|
[[ -n "${_snore_fd:-}" ]] || exec {_snore_fd}<> <(:)
|
|
read ${1:+-t "$1"} -u $_snore_fd || true
|
|
}
|