Write a shell script which: 1. accepts a file name 2. checks if file exists 3....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a shell script which: 1. accepts a file name 2. checks if file exists 3. if file exists, copy the file to the same name + .bak + the current date (if the backup file already exists ask if you want to replace it). 4. ask the user if she/he want to backup another file When done you should have the original file and one with a .bak at the end. What to submit? Upload your code and the following screenshots: 1. What happens when the file name does not exist? 2. What happens when the file exists and user wants to backup the file, and a previous backup file does not exist? 3. What happens when the file exists and a previous backup exists? Write a shell script which: 1. accepts a file name 2. checks if file exists 3. if file exists, copy the file to the same name + .bak + the current date (if the backup file already exists ask if you want to replace it). 4. ask the user if she/he want to backup another file When done you should have the original file and one with a .bak at the end. What to submit? Upload your code and the following screenshots: 1. What happens when the file name does not exist? 2. What happens when the file exists and user wants to backup the file, and a previous backup file does not exist? 3. What happens when the file exists and a previous backup exists?
Expert Answer:
Answer rating: 100% (QA)
Here is a shell script that performs the tasks described bash binbash Function to check if user want... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Discuss the aims of sentencing - punishment, rehabilitation, reparation, deterrent. (individual and general)
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Preparing and interpreting a statement of cash flows using a T-account work sheet. Financial statement data for Dickerson Manufacturing Company for the current year appear in Exhibit 5.29. Additional...
-
Plot the streamlines due to a line sink (m) at the origin, plus line sources (+m) at (a, 0) and (4a, 0). Hint: A cylinder of radius 2a appears +1m tm 2a 24
-
Answer the questions in Exercise 4 for a regular pentagon. (a) Determine the number of distinct ways one can color the vertices of an equilateral triangle using the colors red and white, if the...
-
Water is raised to a height of 40 m by means of a centrifugal pump. If the quantity of water raised is 350 m3/h, determine the power of electric motor required to drive the pump. Take efficiency of...
-
In 1999 Mercedes-Benz USA adopted a new pricing policy, which it called NFP (negotiation-free process), that sought to eliminate price negotiations between customers and new-car dealers. An article...
-
8. We discussed several sorting algorithms this semester. Of the following listed, answer the following questions: Mergsort, Insertion Sort, Quicksort, Counting Sort, Radix Sort a) What is the...
-
The statement of cash flows for Riker Company (prepared using the indirect method) follows. Consider the following additional information: (a) Sales for the year totaled $812,350. Cost of goods sold...
-
Refrigerant-134a at 600 kPa and 150C is contained in a spring-loaded piston- cylinder device with an initial volume of 0.3 m3. The refrigerant is now cooled until its T is -30C and its volume is 0.1...
-
Finest Frozen Foods Pty Ltd employs Bridget Neville as a salesperson. For Bridget Neville tofulfll her employment activities, she travels all over Brisbane. Finest Frozen Foods purchased acar for...
-
John Smith graduated 5 years ago, with a Business degree and an emphasis in Finance. John is currently employed as a Sr . Financial Analyst in the Corporate Finance department of a multinational...
-
Behind the counselling environment as well as the an introduction of the helping skills, you will now critique an important contribution of one of the most influential psychologists, Carl Rogers, in...
-
A convex lens has a focal length of 10 cm. If an object is located a very large distance away from the lens, at what distance away from the lens does the image form?
-
Aaron, Deanne, and Keon formed the Blue Bell General Partnership at the beginning of the current year. Aaron and Deanne each contributed $101,000 and Keon transferred an acre of undeveloped land to...
-
Alkalinity has been defined as the acid-neutralizing capacity of a water, and we commonly use the following definition for the alkalinity of natural waters: Alk (eq/L) = [OH] + [HCO3] + 2[CO3]-[H];...
-
Solve each equation. x 3 - 6x 2 = -8x
-
For each of the following situations, indicate whether the taxpayer(s) is (are) required to file a tax return for 2012. Explain your answer. a. Helen is a single taxpayer with interest income in 2012...
-
Your supervisor has asked you to research the following situation concerning Owen and Lisa Cordoncillo. Owen and Lisa are brother and sister. In May 2012, Owen and Lisa exchange business pickup...
-
Olive Corporation was formed and began operations on January 1, 2012. The corporation's income statement for the year and the balance sheet at year-end are presented below. The corporation made...
-
A crystal sample of bacteriorhodpsin, a light-sensitive protein found in halobacteria that responds to light energy, has crystal planes separated by 0.20 nm. If a beam of 11 keV x rays illuminates a...
-
A nickel crystals work function is measured to be 5.22 eV at 25C. As the temperature increases by 300C, the work function drops by 50 meV. By how much does this shift the threshold wavelength for...
-
Investigators have created structures consisting of linear chains of ionized atoms on a smooth surface. Electrons are restricted to travel along the chain. The energy levels of the electrons match...
Study smarter with the SolutionInn App