Highlights
Task A
Write a shell script (to run on the Bourne shell) called cp2.sh to copy all the files from two named directories into a new third directory. Time stamps must be preserved while copying files from one directory into another.
Task Requirements
1. Three directory names must be supplied as arguments to your script when it is executed by the user.
2. In the beginning of your script you need to check that the first two directory names provided (e.g. dir1 and dir2) exist under the current directory. If they do not exist, your script must display an error message and then it should exit.
3. The third directory argument to the script will specify a new directory name (for example, dir3). This directory must not currently exist (i.e. the creation of e.g. dir3 should be one of the actions of your script). If the directory already exists, your script should display an error message and exit.
4. The script will first copy all of the files from dir1 into dir3. Your script output must indicate which files have been copied.
5. The script will then copy every file from dir2 to dir3 subject to the following conditions:
a. only copy if the file from dir2 is not already present in dir3; or
b. only copy if the file from dir2 is newer than the same file in dir3. The newer file will overwrite the existing version in dir3. Your script output must indicate which files have been copied.
6. Clean up - remove all temporary files created (if any) at the end of your script.
7. Your script must generate output similar to the example output shown below.
This Report Writing Assignment has been solved by our Report Writing Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.