Project Created By:
- Se Hoon Bang
- Kenneth Siu
e.g.: ls will list the contents of the current directory Run "exit" to exit rshell. Use connectors, such as ||, &&, and ; to connect commands however you like.
e.g.: (a && b || c) will run ((a && b) || c) instead of (a && (b || c))) Use # to commment out any part of a command.
e.g.: echo hello world # hello world is printed, but this is not! The project consisted of several steps.
- We got the user input using getline, and parced it into three different vectors - executables, arguments, and connectors.
- We called execvp with the executable (and argument) as parameters.
- We checked whether or not the executable (and argument) was valid and if it was, ran it.
- We had a function to check whether or not the next executable should be run depending on the connectors.
- We had another function which calculates the proper grouping of commands. (e.g.: if we ran a && b || c, it should run ( (a && b) || c ) instead of ( a && (b || c) )).
- We put the whole thing into a while loop so that it would run unless the executable entered is "exit" in which it would then exit the rshell.
- We tested the rshell by outputting our expected output, followed by outputting our actual output.