Question: Write a shell script which: 1. accepts a file name 2. checks if file exists 3. if file exists, copy the file to the

Write a shell script which: 1. accepts a file name 2. checks if file exists 3. if file exists, copy the file

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?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is a shell script that performs the tasks described bash binbash Function to check if user want... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!