Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Programming Language Expert

Assignment: prepare a bash script that will implement the following command:
 
merge [ -i -o ] sourcedirectory1 sourcedirectory2 destinationdirectory
 
The idea is that the contents of sourcedirectory1 and sourcedirectory2 are going to be copied and merged together, according to the options, into a new destinationdirectory. The destination directory should be created (using mkdir) to hold the copied data. The original contents will not be altered. Your shell script should parse the command's options to see what to do, reporting any option errors such as an invalid option, missing or extra directory names, file names rather than directory names, two names that are the same, and a destination directory that already exists. Whenever files and directories are copied, you should preserve the properties as much as possible using the -p option of the cp command. 
 
The command options are as follows: by default the merger is a union operation, so that if a file exists in either source directory it is included in the new directory. If the -i option is used, then the merger is an intersection operation, so that only if a file exists in both source directories will it be included in the new directory. Whenever a file exists in both source directories, by default the newer version of the file should be copied. If the -o option is used, then the older version of the file should be copied into the new directory. You can use the -nt and -ot test operators to compare which of two files is newer or older. If two items that have the same name are not both a file or both a directory, then an error message should be displayed saying that you are skipping this pair of incompatible objects. If the two items with the same name are both directories, then you should call your merging routine recursively to process these subdirectories.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9828

Have any Question? 


Related Questions in Programming Language

In this programming assignment you are asked to simulate

In this programming assignment, you are asked to simulate the recursive factorial function given in the class. Your program is to be a nonrecursive version of the factorial function implemented using a stack. Your progra ...

Assignmenthomework assignments must be individuals original

Assignment Homework assignments must be individual's original work. Discussion without taking notes will be fine, but collaborations will not be tolerated. Dishonesty will result in an automatic F grade and a formal char ...

Write a gui application that prints out hello in either

Write a GUI application that prints out "Hello!" in either: English, French, or Spanish. When the user selects another language, the greeting shown in the greeting area should change. Your GUI should look like the interf ...

Write a program which1 asks the user to enter a letter

Write a program which: 1. Asks the user to enter a letter grade (A, B, C, D, F) or (a, b, c, d, f) 2. Validates that the entry is a letter grade (A, B, C, D, F) or (a, b, c, d, f) 3. The program then asks the user to ent ...

A local zoo wants to keep track of how many pounds of food

A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two dimensional 3 × 7 array, where each row repr ...

Assignmentfor questions 2-9 you must submit your code

Assignment For questions 2-9 you must submit your code together with the output of running your code on some sensible sample input. Submit the input and the output of your program along with your code. Question 1 Conside ...

Assignmentan office building has 5 floors 4 levels above

Assignment An office building has 5 floors (4 levels above ground and a basement at level 0). There are 8 offices per floor, labeled A - H. This program will maintain data about the occupant type of employees in each off ...

Write an mdi project that is a simple text editor allow the

Write an MDI project that is a simple text editor. Allow the user to open multiple documents, each in a separate child form. For the text editor, use one big textbox control with its multiline property set to True or a R ...

Lab 1a box of cookies can hold 24 cookies and a container

Lab 1 A box of cookies can hold 24 cookies, and a container can hold 75 boxes of cookies. Write a program that prompts the user to enter the total number of cookies, the number of cookies in a box, and the number of cook ...

Lab stackslab exerciseimplement the following classesclass

Lab: Stacks Lab Exercise: Implement the following classes: Class Course that includes three instance variables: private int ID; // course ID private String Name; // course name private Course next; // link next Your clas ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen