The goal of this project was to create a Unix shell using system level I/O in C language. The shell implements most common Unix commands such as cd, ls, piping, I/O redirection and more. The parsing of command lines was extracted away in this project, however I have completed this task in another smaller shell based project.
Command lines were parsed into trees with four types of nodes, one that processed commands and AND, PIPE and SUBTREE operators.
I was tasked to design the executor which received the parsed commands and processed them based on the given tree structure.
I was also responsible for the make file that compiled all .c files into one "d8sh" executable.
Our program was to make use of practices such as dup2 for I/O redirection, as well as exec and piping to properly execute the commands that were input.
This project was short in length, however, long in complexity. Our execute command used only one recursive function which handled the tree. It's first check was to determine the current node of out command line tree, and subsequently performed I/O redirection for each node before processing it accordingly.
This project ended up being successful. I passed all required tests and was even able to submit my project through the shell I built. The shell has the same general functionality as the Linux virtual application that it was coded in and can execute all common commands. While my program passes all required tests for my class, there are error checks that I could implement in order to make the shell more seamless and less fragile to inoperable commands.
Image 1 below displays successfully executed commands; Image 2 displays proper recognition of errors and the limitations of the shells error checking.