Question: Stage 4 : Changing directories 1 0 marks cd change working directory This command has two forms. In the first, it has no parameters and

Stage 4: Changing directories 10 marks
cd change working directory
This command has two forms. In the first, it has no parameters and changes the working
directory to the users home directory. In the second, it has one parameter which is a
directory (either in full path or relative path form) and changes the working directory
to the directory provided as a parameter. If the directory provided does not exist, then
it should say that there is no such directory. In fact, you must go further and utilise the
error value of the system calls using the perror() function. The shell should check
appropriate parameters are used by the user and provide informative messages if this
is not the case. Note, though, that any string could be considered a path as far as the
command is concerned.
Remember that directory changes are effected with the chdir() function.
Remember that . and .. refer to the current and the parent directory and they can be
used as part of the path.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!