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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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