Question: SECURE SCRIPTING ( PYTHON ) ADVANCED CONTROL This lab walks you through building a simple file system scanner. The scanner will be able to do

SECURE SCRIPTING (PYTHON)
ADVANCED CONTROL
This lab walks you through building a simple file system scanner. The scanner will be able to do three things. First, it will generate a list of files and file attributes, including a checksum of each file's contents. Second, it can compare the files and file attributes of the files in the directory with that list. Third, it can delete that list.
For this lab, you will need the five files in the subdirectory "sample". Please do not change anything in that directory - one of the tests you need to run depends on those files being unchanged.
abc xyz
abcde
demofor
demofor2
demofor3
LAB EXERCISE 1
This exercise starts you off. You do not need to write any scripts until Part D. First, list the attributes of the files in the directory "sample", one per line.
a. When you execute the command Is with the -I option, which of the desired attributes are printed?
. What does the command shasum print?
c. How would you cause both outputs to be printed on the same line?
p. Write a shell script that uses a for loop to list the attributes of the files in the directory "sample", one per line. Call this script "
scan1.py".
Run your script. You should get information for six files, including the one you wrote. The checksums of the files "abcde" and "
demofor.sh" are: da39a3ee5e6b4b0d3255bfef95601890afd80709 abcde 031b3606cf69ac7144a6fc47e9495d690b669084
demofor.py
SECURE SCRIPTING ( PYTHON ) ADVANCED CONTROL This

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!