script
script copied to clipboard
Exit status code for command not found
Hi @bitfield,
I believe I've found a reason why script should return a specific status code for command not found There are only 4 reasons to make an exec fail:
- E2BIG - The argument list exceeds the system limit.
- EACCES - The specified file has a locking or sharing violation.
- ENOENT - The file or path name not found.
- ENOMEM - Not enough memory is available to execute the new process image.
The syscall exec sets errno ENOENT. It doesn't need to be 127 but I think it's quite convenient since we are "porting" shell scripts to Go.
Reference https://en.wikipedia.org/wiki/Exec_(system_call)