Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1- Linux Bash cleanUp.sh Script This is about keeping a directory free of junk files. To be specific, we want to remove files that are

1- Linux Bash cleanUp.sh Script

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) ls -l the TEST directory, (iii) invoke cleanUp TEST, and again (iv) list-long the ls -l the TEST directory.

For your answer,Copy-paste the result of ls -l 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 ls -l in the TEST directory after running your script. Copy and paste your "cleanUp.sh" file to the answer field for this question.

2- Windows Python cleanup.py

In Windows, develop a Python 2.x script, cleanUp.py, equivalent to the cleanup Bash script from a previous question. Use standard windows commands or python functions. Your script must delete 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 #.

Test cleanUp.py: (i) create a new directory named TEST in the current directory, create a few files (say 4 each of names chosen by you) that fit the three categories of junk files in TEST, (ii) Use the Windows Cmd program and the Windows DIR command to show the contents of a TEST directory before running your script, (iii) invoke cleanUp.py, and again (iv) Use the DIR command to show the contents of the TESTdirectory after you ran cleanUp.py.

For your answer, provide the python version you used and copy paste the results of the Windows DIRcommand showing the contents of a TEST directory before and after running your cleanup.py script. Copy and paste your "cleanUp.py" to the answer field for this question.

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

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

107 MA ammeter 56 resistor ? V voltmeter

Answered: 1 week ago

Question

Generally If Drug A is an inducer of Drug B , Drug B levels will

Answered: 1 week ago