Menu

[Solved]Windows Write Python 3 Program Cleanuppy Meets Requirements Bash Cleanupsh Part 1 Lab Proc Q37139488

On Windows, write a Python 3 program, cleanup.py, that meets thesame requirements as the Bash cleanup.sh from Part 1 of this Labprocedure. You must also implement a test harness for cleanup.py -you are welcome to reuse the same test harness from Part 1 if youcan make it work with cleanup.py.

Part1

On Windows usingGitBash or on Linux, write a program to delete “junk” files. To bespecific, we want to remove files that are backups and auto-savedversions.

  1. Create a file “cleanUp.sh”. Use this file to write your scriptin Bash.
  2. In cleanUp.sh, develop a Bash function called cleanUp() thatdeletes all backup and auto-save files from the givendirectory.
  3. Assume that names of back up files end in either:~  or .bak, and auto-save files have names beginning witha #.
  4. Develop a test harness[https://en.wikipedia.org/wiki/Test_harness] that tests thecleanUp() function you wrote.

A test() function inyour test harness should:

  • create a new directory named TESTin the current directory
  • create a few files (say a 4 eachof names chosen by you) that fit the three categories of junk filesin TEST
  • ls -l the TEST directory
  • invoke cleanUp TEST, andagain
  • ls -l the TEST directory.

Expert Answer


Answer to On Windows, write a Python 3 program, cleanup.py, that meets the same requirements as the Bash cleanup.sh from Part 1 of… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *