Copy one file to another.

Assignment Help Database Management System
Reference no: EM13947914

Create a script that will allow the user to enter one of several choices from the command line. The specific requirements are as follows:

1. Copy one file to another. The user enters the source and destination file to copy to and from. The script shall handle the following cases:

a. Source file name specified does not exist. Script shall display an error message and terminate. Optionally, the script can display an error message and prompt the user to specify the source file name to copy from.

b. Source and destination files both exist. Script shall prompt for permission to overwrite the destination file. If permission is denied, program will display message and terminate.

c. Source file specified with no destination file specified. Script shall display error message and terminate or optionally, it can prompt the user to enter the file name to copy to.

2. Remove a file if it exists. The user provides the name of the file to remove or delete. Display a message indicating success or failure back to the user and terminates. The script shall handle the following conditions:

a. If the user enters the remove file option but no file name specified the script shall display an error message and terminate or, optionally, display an error message and prompt the user for the file name to remove and remove the file if it exists.

b. If the specified file does not exist the script shall display an error message and terminate.

3. Display the current day of the week. The script shall allow the user an option to display the day of the week.

4. Display the month's calendar. The script shall allow the user an option to display the month's calendar.

5. The script should be named commands.sh and accept options in the command line as either -r or -R for removing a file, -c or -C for copying a file, -d or –D to display the day of the week and –m or –M to display the month's calendar.

6. If the user enters command.sh without any options the script shall display the usage examples as shown below.

7. The script shall include the option and the necessary positional parameters information to perform the options as follows:

Copy a file:

prompt$ ./commands.sh –c sourceFile destinationFile
prompt$ ./commands.sh –C sourceFile destinationFile

Remove a file:
prompt$ ./commands.sh –r fileName
prompt$ ./commands.sh –r filename

Display day of week:
prompt$ ./commands.sh –d
prompt$ ./commands.sh –D

Display month's calendar:
prompt$ ./commands.sh –m
prompt$ ./commands.sh –M

Reference no: EM13947914

Questions Cloud

Which is describes how a master budget is used : Which is best describes a nonfinancial performance measure contained in most Balanced Scorecards? Which is describes how a master budget is used?
What is bestcares net working capital for 2011 : How does this balance sheet differ from the ones presented - What is Green Valley's net working capital for 2011 and What is BestCares net working capital for 2011
What is the purpose of a balanced scorecard : What is the purpose of a Balanced Scorecard? According to the Balanced Scorecard, what is a strategy? Explain the difference between lag measures and lead measures.
Define a class named document that contains an variable : Define a class named Document that contains an instance variable of type String named text that stores any textual content for the document. Create a method named toString that returns the text field and also include a method to set this value.
Copy one file to another. : Source and destination files both exist. Script shall prompt for permission to overwrite the destination file. If permission is denied, program will display message and terminate.
Estimate the optimum moisture content : A silty clay soil has a plasticity index (PI) of 14. Estimate the optimum moisture content and the maximum dry unit weight of the soil when compacted using the procedure of:
Calculate the ultimate holding capacity of anchor : In Figure 14.40a, for the anchor slab in sand, H 5 1.52 m, h 5 0.91 m, B 5 1.22 m,S9 5 2.13 m, f9 5 308, and g 5 17.3 kN/m3. The anchor plates are made of con- crete and have a thickness of 76 mm. Using Ovesen and Stromann's method, calculate the u..
What is your definition of normal and definition of abnormal : What is your definition of Normal and your definition of Abnormal? How do we determine what is considered to be Abnormal Behavior
Discuss any ethical or legal issues you might have to : Describe the topic and explain the different types of sources you plan to review. In addition to literature reviews, are you considering conducting primary research for your project? If so, please describe. If not, describe what type of primary resea..

Reviews

Write a Review

Database Management System Questions & Answers

  Suppose that you are the database developer for a local

suppose that you are the database developer for a local college. the chief information officer cio has asked you to

  Write and execute sql definition commands

Write the SQL DDL to create the database that contains each of the relations shown in the above ERD and write and execute SQL definition commands

  Percentage of elapsed time

Let us assume that a program takes 400 seconds of elapsed time to execute. Out of these 400 seconds, 320 seconds is the CPU time and the rest is I/O time. What percentage of elapsed time is spent on I/O operations?

  Design a database - what is the purpose of your database

Design a database, a database planner should spend a considerable amount of time thinking about what kind of information will be included in the database and how it will be organized.

  Create database that contains the inventory of organization

Create a database that contains the inventory of your organization's technology, as well a table including employee information. Build your database named IT_inventory, linking users to workstations, i.e., each computer (desktop or notebook) will b..

  Creating a database and then adding to it a foreign key

creating a database and then adding to it a foreign key constraint

  Do that most companies need this type of implementation

Do you think that most companies would need this type of implementation? Why?

  Optimize the query in the select script using alter table

optimize the query in the select script using Alter Table to add appropriate indexes. Also use Optimize and Explain to show how the performance of this query has improved.

  Write the proper sequence of activities in the design

Write the proper sequence of activities in the design of a video rental database. The initial ERD is shown in above (or refer to textbook figure 9.9). The design must support all rental activities, customer payment tracking, and employee work sche..

  What is the most common disease for each age group

Explore a possible relationship between the DRG_PRICE and the TOTAL_CHARGES. Is there a linear relationship between these two properties?

  Show the count of the class after deleting

Will insert any first name, last name, ID, GPA, and phone number, in the proper location in the list sorted alphabetically by last name.  After insertion, you should show the count of the class.  Then print the list after you insert.

  Co-related sub-query to return one row per customer

Use a co-related sub-query to return one row per customer, representing the customer's oldest order (the one with the earliest date).

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd