Question: Tnis exercise uses the copy or tne script you savea after completing Lab Exercise 2 A . We will be modifying it in a way
Tnis exercise uses the copy or tne script you savea after completing Lab Exercise A We will be modifying it in a way similar to the rest of Lab Exercise
A At the beginning of the script, add a line that defines a variable called TMP and give it the initial value tmpprocessIDtxt Then add another line that creates the file named by the value of TMP Call this script
scanapy What is the actual name of the file created?
In the for loop, before you print the file attributes, check to see if the file being examined is the file named by the value of TMP and if so immediately go to the next file that is do not get the file attributes Call this script
scanbpy
c Modify your script so that the attributes are stored in the file named by the value of the variable TMP Call this script
scancpy
D After the loop, print the message "Changed files:", and then compare the contents of the files named by TMP and MASTER. Use diff to generate the comparison. Call this script
scandpy What happens if the file named by the value of MASTER does not exist?
E Before the loop, check that the master file the file named by the value of MASTER exists. If it does not, print an error message saying "Master file does not exist; please generate it and exit with an exit status code of Call this script
scanepy
F Conclude by using the command to delete the file named by the value of TMP after the comparison in Part D Again, have the script exit with an exit status code of Call this script
scanfpy
When you test this script, the MasterList file must already exist. If it does not, execute the script you wrote in Lab Exercise
You should get at least one line for the file MasterList. You will also get other lines corresponding to the scripts you wrote. As long as you get the line for MasterList, you're doing it right.
Also, from the command interpreter, check the exit code. Immediately after you execute your script, type
echo $
This prints the exit status code of the command that finished most recently. That command is your script. So you should see
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
