How can I get the exit status of the command I am running?