Design a script that will allow the user to enter one

Assignment Help Computer Engineering
Reference no: EM1336455

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: EM1336455

Questions Cloud

Explain about marketing : Explain about Marketing and Discuss the dimensions for segmenting markets and Provide a succinct overview of the key components of a marketing plan
How to define a class named document : express 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.
Show the important hr skills for supervisors : Important HR Skills for Supervisors - Demonstrating Communication Skills and Determining Effective Orientation and Training Methods
Management of human resources : What do you think about the way executive compensation has escalated over the last several years and Do you think it is justifiable? Why or why not?
Design a script that will allow the user to enter one : make a script that will allow the user to enter one of several choices from the command line.
Explain consumer behavior principles : Explain Consumer behavior principles and Explain the roles of learning and memory theories in developing marketing strategies
Expalin the file system that will be installed : define the file system that will be installed in the server of your local hospital to support remote access of information by the hospital's doctors while they are using their mobile devices such as cellular phones or PDAs.
How does project planning improve the chances : How does project planning improve the chances of project success and Who is involved? Roles and responsibilities
Define a way to insert a row : How do I insert a row in multiple tables on different sheets in the similar workbook? I have 12 sheets, one for every month, and the sheets are exactly the same. Is there a way to insert a row and value on one sheet and have this apply to all sheet..

Reviews

Write a Review

Computer Engineering Questions & Answers

  Enterprising the data mining and data warehousing

Discuss the most proficient ways in which an organization may invest in enterprising the data mining, data warehousing, and the data analytics capabilities.

  The difference between animation and transition effects

When are they appropriate? When is it better not to use them? Can you give me an examples.

  Write down the definitions for the member functions

Add a boolean process "contains" to class SList that returns true if its parameter is in the list and false otherwise. Use the binary search algorithm.

  Define corrective, adaptive, perfective, and preventive

explain an example of each of the four types of maintenance: corrective, adaptive, perfective, and preventive. Discuss how the decision to proceed is reached in each case. Be specific.

  Consider whether there should be a hard

normally , we use normalization techniques a database. using the bowen et al. (2004) article, discuss the disadvantages of normalizing the database to a high degree of normalization.

  Decision-making process

Banner advertising on the Web sites helps activate the realization that there is a gap between the reality and desired state that happens in the --------------- stage of EC purchase decision-making process.

  The application must have at least one class

A salesperson can also receive a commission as a sales incentive. Commission is a percentage of the salesperson's annual sales. The current commission is 5 percentof total sales.

  Economic life of technology product

Explain what do you understand by the economic life of a technology product. Discuss how does economic life of the technology product is compared with the technology life and product life?

  Determine the average number of tries

Write down a program in C++ to play a guessing game with the user. The program should be able to make a guess about the chosen number by the user and ask whether the guessed number is above or below the chosen number.

  Using a simulator the boson simulator

Using a simulator the boson simulator (or routers) I want to create a four router topology. Using any interfaces of my choice. I am given /24 networks - choosing interface addresses from the given network ID.

  What are the characteristics of application

offer examples of business applications that exhibit these characteristics. You can provide examples of applications from any client/server development environment. The two main platforms are Microsoft .NET and Sun JAVA J2EE.

  Why the whodunit system design had a great start

The Whodunit system design had a great start, and providing more detail is the next appropriate step in the design process. Collaboration diagrams help give this additional detail, and they will be the focus of this assignment.

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