Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is about keeping a directory free of junk files. To be specific, we want to remove files that are backups and auto-saved versions. Create

image text in transcribed

This is about keeping a directory free of "junk" files. To be specific, we want to remove files that are backups and auto-saved versions. Create a file "cleanup.sh". Use this file to write your script. Develop a Bash procedure called cleanUp() that deletes all backup and auto-save files from the given directory. Assume that names of back up files end in either (i) or (ii) .bak, and (iii) auto-save files have names beginning with a #. Develop a test harness that tests the cleanUp() procedure. The test() procedure should (i) create a new directory named TEST in the current directory, create a few files (say a 4 each of names chosen by you) that fit the three categories of junk files in TEST, (ii) Is -I the TEST directory, (iii) invoke cleanup TEST, and again (iv) list-long the Is -I the TEST directory. For your answer, Copy-paste the result of Is -I in the TEST directory prior to running your script. Copy-paste the command line you used to run your script. Copy-paste the result of Is -I in the TEST directory after running your script. Copy and paste your "cleanup.sh" file to the answer field for this

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