In order to get the exit status for a process:

echo $?