How can I spawn a process after a delay in a shell script? I want a command to start 60 seconds after the script starts, but I want to keep running the rest of the script withou
A slight expansion on the other answers is to wait for the backgrounded commands at the end of the script.
#!/bin/sh # Echo A 60 seconds later, but without blocking the rest of the script set -e sleep 60 && echo "A" & pid=$! echo "B" echo "C" wait $pid