int err();
void cd(char* final);
void parse_args( char* line, char** arg_ary);
void exitP();
char* takeOut(char* command);
int check(char* input);
char** separateP(char* line, char** commands);
void pipe1(char** command);
void pipe2(char* cmd);
char* takeOut(char* command);
char** separateRO(char* line, char** commands);
char** separateRI(char* line, char** commands);
void separate(char* line, char** commands);
char* executeO(char* commands);
char* executeI(char* commands);
- Change Directory: changes directory to the intended path. If no path specified returns the user to home directory.
- Exit: user exits from the shell into their regular shell following message prompting, “exiting program”
- If the command is not
exitorcd,execvp()executes the command within main in a child process. Parent process will execute the following commands in input after waiting for the child process to finish running the previous command. - Can handle multiple commands in one line (using semicolons)
- If stdin contains redirect (> or <), stdin will be manipulated:
- Inputs split into array with two commands (separated by > or <)
- Depending on
>or<, the file is redirected to stdin or stdout respectively
- Can detect an end of file when inputting a file into
./shell.out - If pipe detected:
- Output of the first command is used as input of the second command
- Pipe can be utilized in addition to other commands (that does not also include pipe) with semicolons (;)
- Checks if command is valid or not
- Added current directory path to prompt
- implemented colors into user prompt
- We attempted
a < b > cbut couldn’t get it to work