Is it possible to put a process into the background from another background process with bash?
For instance, if we have the following code:
function check_if_server_running {
while [ server_running -ne true ]
curl localhost:8000
done
bg %-
}
check_if_server_running &
./startServer
# Some other code...
Could we replace bg %- with something to make the ./startServer run in the background once it's up? Normally bg %- puts the last process in the background but it is not working for me