Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What does this have to do with ttys or terminals though?


Exit codes are only used in the context of terminal shells. So it seems appropriate to refer to terminals. Wouldn't you agree?


That's not the case at all. Every process produces an exit status when it terminates and many things besides interactive shells use them. Pretty much anything that runs a subprocess should retrieve the exit status to see if the child process was successful and log the failure if nothing else.

Some random examples: Automated build systems like Jenkins typically use the exit status to decide if a build task has succeeded. `make` also uses exit codes to decide if a child task has succeeded and may abort the rest of the build based on that and return an exit code itself. A local mail delivery agent like maildrop may return different exit status depending on if it's a permanent or temporary failure and the mail transfer agent decides if it should retry the local delivery based on that. The exit status of a Docker of Kubernetes container is usually based on a process exit status too.


Perhaps, but wait() and waitpid() do fill the status, and have no concept of a tty.


The TTY family of gems which this is a part of are focused on making development of CLI programs easier.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: