echo $?

 

echo $? 

View the principle of command execution failure or success of the
"process life cycle"

    When a process is finished, the process calls _exit routine called to inform the kernel it has already done the "demise" of the preparation. This process will provide an exit code (an integer) shows why it is ready to exit. By convention, 0 is used to indicate normal or termination of "success".

That exit code back to us in the implementation of anti-echo $? Value is the process. Moreover, the exit code is provided by the process has just been executed to the system kernel.

Guess you like

Origin www.cnblogs.com/jrri/p/11563926.html