I have a C++ executable named Test
. I want to find out the GetExitCodeProcess()
code when the execution is completed.
I can find out the status code by writing the following in another wrapper program as such:
...
int status = system("./Test");
and then check for WIFSIGNALED / WIFSTOPPED etc statuses.
However, instead of writing a wrapper program, can I get the exit status code from the PID of the .Test
program by writing a bash script?
Edit: Does writing a $
in the bash after executing ./Test
give the solution to the above problem?
Edit: Summary is -- when I run an executable from the command line, how do I (not a program) get the exit status?