in reply to return result from system ?

The return result of system is the $? value from wait. It also sets $?.

The lower bits of the status code include flags to indicate if the process exited because of a signal or core dump. $? & 127 gives the signal number.