This is a command shell. Programmed in C++ and makes use of execvp, waitpid, and fork.
Has the same functionality as a regular terminal.
We will be creating a project that allows us to take in commands from the command line in bash and we will be using connectors to execute them. By using a composite design pattern consisting of Connector class as the composite and a command class as a leaf, we are able to accomplish this
";" = The following command will always be executed.
"||" = If the current command fails, the following command will be executed.
"&&" = If the current command succeeds, the following command will be executed.
"#" = Everything after "#" will be a comment.
"[]" = Symbolic version of the command "test".
"()" = Used to change the precedence of the returns of commands, connectors, and chains of connectors.
"exit" = Will exit the entire command line and program.
"mkdir" = Creates a directory from the terminal.
"pwd" = Displays the pathname of the current directory.
-e checks if the file/directory exists
-f checks if the file/directory exists and is a regular file
-d checks if the file/directory exists and is a directory
$ git clone https://github.com/apham024/rshell.git
$ cd rshell
$ git checkout hw4
$ make
$ bin/rshell
Annie Pham
Sabrina Wong
Cannot 'cat' if file is empty; 'cat' does somewhat work with something in the file
Currently outputs an error when 'cat' is used