Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

is this the right answer 7. Homework Your task is to create a bash shell script that is able to backup all the C# program

is this the right answer image text in transcribed
image text in transcribed
7. Homework Your task is to create a bash shell script that is able to backup 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 backuped. . Otherwise, no copy will be made, and print a message that the file is the latest CSE 4600 Homework I Shell Programming Deliverables: 1. The code of bash shell script hwl.txt. The shell script file should be hwl sh, but sh files can not uploaded to Blackboard, please revise the extension as txt and then upload it to Blackboard, 2. The script log file hwilog.txt showing the test cases outlined below #!bin/bash echo "enter directory name to backup" read dirname echo " enter directory name id $dirname" fi FILES=*.cpp for file in $FILES do found=' find . -type f-name "dirname/$file" print' if [-z "$found" ]; then echo "Not found, Backingup file file... here" cp $file dirname/ echo "Backedup $file file..." else echo "Found the file" if ["$file" -nt "$dirname/$file"] then printf '%s' "$file is newer tahn backedup file" echo "Backingup $file file...her" cp $file $dirname/ echo "Backingup file file..." fi fi found= 'find. -type d name "dirname" -print' if ( -z "$found"]; then echo "Notfound, so we can create the directory here" mkdir dirname else echo "found the directory" fi

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

Recommended Textbook for

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions