$ strace -fe execve perl -e '$code=system("exit 3"); print("Finished with $? (or ",$?>>8,") $code (or ",$code>>8,")\n");' execve("/usr/bin/perl", ["perl", "-e", "$code=system(\"exit 3\"); print(\"F"...], [/* 51 vars */]) = 0 strace: Process 24553 attached [pid 24553] execve("/home/username/perl5/bin/exit", ["exit", "3"], [/* 51 vars */]) = -1 ENOENT (No such file or directory) [pid 24553] execve("/usr/local/bin/exit", ["exit", "3"], [/* 51 vars */]) = -1 ENOENT (No such file or directory) [pid 24553] execve("/usr/bin/exit", ["exit", "3"], [/* 51 vars */]) = -1 ENOENT (No such file or directory) [pid 24553] execve("/bin/exit", ["exit", "3"], [/* 51 vars */]) = -1 ENOENT (No such file or directory) [pid 24553] execve("/usr/local/games/exit", ["exit", "3"], [/* 51 vars */]) = -1 ENOENT (No such file or directory) [pid 24553] execve("/usr/games/exit", ["exit", "3"], [/* 51 vars */]) = -1 ENOENT (No such file or directory) [pid 24553] execve("/home/username/.local/bin/exit", ["exit", "3"], [/* 51 vars */]) = -1 ENOENT (No such file or directory) [pid 24553] +++ exited with 255 +++ --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=24553, si_uid=1000, si_status=255, si_utime=0, si_stime=0} --- Finished with -1 (or 72057594037927935) -1 (or 72057594037927935) +++ exited with 0 +++ #### $ strace -fe execve perl -e '$code=system("ps > /dev/null;exit 3"); print("Finished with $? (or ",$?>>8,") $code (or ",$code>>8,")\n");' execve("/usr/bin/perl", ["perl", "-e", "$code=system(\"ps > /dev/null;exi"...], [/* 51 vars */]) = 0 strace: Process 24618 attached [pid 24618] execve("/bin/sh", ["sh", "-c", "ps > /dev/null;exit 3"], [/* 51 vars */]) = 0 strace: Process 24619 attached [pid 24619] execve("/bin/ps", ["ps"], [/* 51 vars */]) = 0 [pid 24619] +++ exited with 0 +++ [pid 24618] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=24619, si_uid=1000, si_status=0, si_utime=0, si_stime=1} --- [pid 24618] +++ exited with 3 +++ --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=24618, si_uid=1000, si_status=3, si_utime=0, si_stime=0} --- Finished with 768 (or 3) 768 (or 3) +++ exited with 0 +++