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
demofor
demofor
LAB EXERCISE
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
scanpy
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: daaeeebbdbfefafd abcde bcfacafcedb
demofor.py
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
