QNX RTOS v4 Knowledge Base
  
QNX RTOS v4 Knowledge Base
  
    
      | 
          
            | Title | From the shell how can I tell what the return value of the last executed program was? |  
            | Ref. No. | QNX.000010028 |  
            | Category(ies) | Utilities |  
            | Issue | When a program exits, it has the option of returning an 'exit code' to the process which spawned it.  In C code with would be done with: return(EXIT_CODE); OR exit(EXIT_CODE); 
 It is often useful to find out what exit code a program terminated with when running it from a shell prompt.
 |  
            | Solution | 'echo $?' will output this exit code. |  |