Get the latest tech news
Write a Shell in C (2015)
A tutorial on how to write a Unix shell in C.
Since most programs aren’t Init, that leaves only one practical way for processes to get started: the fork() system call. This is so that, in the future, builtin commands can be added simply by modifying these arrays, rather than editing a large “switch” statement somewhere in the code. That link goes straight to the current revision of the code at the time of this writing– I may choose to update it and add new features someday in the future.
Or read this on Hacker News