Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your task is to create a bash shell script that is able to back up all the C++ program files in your current directory. The

Your task is to create a bash shell script that is able to back up all the C++ program files in your current directory. The algorithm is as follows: Prompt the user to enter a backup directory name. If the backup directory does not exist in the current directory, then create the backup directory. For each .cpp file in the current directory, If there have been changes to the file since the last backup or no copy exists in the backup directory, then copy the current .cpp file to the backup directory and print a message that the file has been back uped. Otherwise, no copy will be made, and print a message that the file is the latest. Deliverables: 1. The code of bash shell script hw1.txt. The shell script file should be hw1.sh, but .sh files can not be uploaded to Canvas, please revise the extension as .txt (mv hw1.sh hw1.txt) and then upload it to Canvas. 2. The script log file hw1log.txt shows the test cases outlined below Test Cases captured in hw1log.txt :

CSE 4600 Homework 1 Shell Programming 1. Start by removing your backup directory (rm -r backup) 2. Ensure that there are some .cpp files in the current directory 3. Show the directory using ls -l 4. Run the backup script file hw1.sh several times as specified below: Type "backup", to create a backup directory ls -l backup Run your backup script file hw1.sh ls -l backup Append to all the files and rerun your backup script file hw1.sh a good way to append is to type: echo "something" >> file.cpp Append to one file and rerun your backup script file hw1.sh Create a new .cpp file (using touch) and rerun your backup script file hw1.sh

**Please post the code and output thank you!**

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions