your shell must accept a change directory command


Your shell must accept a change directory command. This will be in the form: cd path  where cd is the change directory command and the path is what you will change the directory to. As you will be parsing all commands from the user, this should be broken into two char* elements. You can simply call chdir() from unistd.h and pass the path string. Be sure to check if the command worked properly. This can be done by checking the return value of the function. If the function results in an error, you must print an error message. Once again this can be done by calling perror(). Finally, regardless of if the command was successful or not, the prompt should be printed on a new line.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: your shell must accept a change directory command
Reference No:- TGS0221930

Expected delivery within 24 Hours