Write bash script to copy file from one location to another

Assignment Help Programming Languages
Reference no: EM1362203

Write a bash script called mycopy that copies a file from one location to another. An example of running the script is given below:

mycopy hello.c examples/example1.c

The script should take the source and destination filenames as arguments.

The following conditions should also be handled by the script:

If only the source filename argument is given (i.e. only one argument), then the script should ask the  user to enter the destination;

If the source file does not exist on the filesystem, the script should print an error message, saying that the file does not exist, and exit;

If the destination file already exists, the script should ask the user whether they would like to replace it, rename it, or exit;

If no arguments are given, the script should print out the following usage information and exit. Usage: mycopy source [destination]

Reference no: EM1362203

Questions Cloud

Illustrate between tort law - commercial productivity of us : Illustrate what do you think about the relationship between tort law and commercial productivity in the United States. Do you believe that companies should enjoy greater protections against potential tortfeasors.
Devising a game plan : Find what you think are the two most important options for devising a game plan to become a critical thinker, and explain how you will try to implement them in your own life.
Compute the work done by this field on a charge : how to Compute the work done by this field on a charge.
Explain and create a matrix or sample evaluation tool : Explain and Create a matrix or sample evaluation tool that details the factors you believe CEO compensation should be measured by in a company
Write bash script to copy file from one location to another : Write a bash script called mycopy that copies a file from one location to another. An example of running the script is given below.
Free markets and the prescription drug industry : Utilitarianism claims free and competitive markets can help maximize the overall good. In your own words, do you believe that a free and competitive market should determine the success of a product or service?
Calculate each company cash balance : Below are summary cash flow statements for three roughly equal-size companies. Determine each company's cash balance at the end of the year.
What is the magnitude of the acceleration of the rock : A rock of mass 32kg accidentally breaks loose from the edge of a cliff and falls straight down. The magnitude of the air resistance that opposes its downward motion is 274N. What is the magnitude of the acceleration of the rock.
Development of the critical thinker : Explain the first four stages in the development of the critical thinker - Describe the first four stages in the development of the critical thinker.

Reviews

Write a Review

Programming Languages Questions & Answers

  Explain some ways tables can be used on web page

Tables are one of the most useful page layout tools available to web designers. Explain some ways tables can be used on a web page. Elaborate on other ways to achieve the same look.

  Designing the site links

Company needs to be able to schedule the time of day when the connections are available for replication. Replication should not occur during peak business hours. When designing the site links, which of the following options should you use?

  Creating printstream object using dos

Create a PrintStream object using dos and assign the resulting reference to ps, a PrintStream variable that has already been declared.

  Create visual basic windows application

Create Visual Basic Windows application. Use following names for solution and project, respectively: Raise Solution and Raise Project.

  Use of various bash commands

Assignment On: This work will require scripting the use of various bash commands and / or small programs that involve directory and file structures.

  Void function to display in nicely formated way

Write a void function display_exer() that display in a nicely formated way the eat members of an exerclass object. Pass the object to the function by reference.

  Program a maze-type game using assembly language

Project requires you to program a maze-type game using Assembly Language, it is not acceptable to use any other programming language for this project

  Automate the task of invigilator allocation

you are required to carry out the following to automate the task of invigilator allocation which may not be limited to one's own department.

  Give hypertext link of the internet location of program

Describe in one or two paragraphs what you observe. Give hypertext link of the internet location of the program (or applet) you found.

  Prolog program to reads employee-s number

Write a prolog program that reads an employee's number from the keyboard, number of hours worked and an hourly rate of pay.

  Advantages and disadvantages for windows login

The Windows login can be a user or a group with users defined to the group. What do you think the advantages and disadvantages are for each type?

  Write class postfixevaluator to evaluate postfix expression

Write a class PostFixEvaluator that evaluates postfix expression such as 6 2 + 5 * 8 4 / -. Program must read a postfix expression consisting of digits and operators into a StringBuffer.

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