I am writing bash script and have the situations when process finishes with error before wait in the following example code:
./process <params> &
PID=$!
wait $PID
And wait $PID
gives me zero. How can i get the real exit code of background process in this situation?
Thanks in advance!