Sleep
sys_sleep¶
Sleep for a given duration without calling the external sleep(1) command. Uses read's -t timeout against a process-substituted null command, which keeps the file descriptor alive for the full duration (unlike /dev/null which may return EOF immediately). Supports fractional seconds where bash does.
Example¶
sys_sleep 1
sys_sleep 0.2
sys_sleep 30
Arguments¶
- $1 (number): Duration in seconds (integer or decimal, e.g. 1, 0.5, 2.5)
Exit codes¶
- 0: Always (read timeout is an expected non-zero exit; it is suppressed)