Simple Shell

Terminal icon

The goal of this project was to implement a simple Unix shell, which would provide the following set of core features: execution of user-supplied commands with optional arguments, selection of typical built-in commands, redirection of the standard output of commands to files, composition of commands via piping, redirection of the standard error of commands to files or pipes, and a directory stack. The shell must spawn a prompt when it is ready to accept user input, as such:

                        

sshell$ echo Hello world
Hello world
+ completed 'echo Hello world' [0]
sshell$

The shell also supports output redirection and piping, using the meta-characters ">" and "|". Here are some examples of the shell in action:

                        

sshell$ echo Hello world>file
+ completed 'echo Hello world>file' [0]
sshell$ cat file
Hello world
+ completed 'cat file' [0]
sshell$

                        

sshell$ echo Hello world | grep Hello|wc -l
1
+ completed 'echo Hello world | grep Hello|wc -l' [0][0][0]
sshell$

If you would like to see the nitty gritty details of my implementation, please contact me at my email below!