Want a delay in a bash script. And you don't like to see the sleep command polluting your ps output? Try this:
#!/bin/bash
pipe=$(mktemp -u)
mkfifo "$pipe"
exec 3<>"$pipe"
doSleep() {
read -t "$1" -u 3
}
It opens a UNIX fifo file on file descriptor 3, deletes it immediately so it does not show up in the temporary directory and cannot be fooled around with. The doSleep makes use of the timeout feature of the builtin read command. Have fun sleeping.







