Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using only the commands, utilities and programmatic techniques addressed in lecture slides 1 - 8 inclusive, write a script that, in addition to the functionality
Using only the commands, utilities and programmatic techniques addressed in lecture slides inclusive,
write a script that, in addition to the functionality provided by logparsersh as developed for Portfolio
also offers the following functionality.
Prompts for the log file name and output file name as applicable instead of requiring that these be
provided as command line arguments when the script is run.
Offers a set of three command line options flags that enables filter functionality that:
o Returns filters only those rows that contain a single matching search term provided by the
user
o Returns filters only those rows that contain both of two matching search terms provided by
the user
o Allow a generated results file to be compressed into a zip file
These three command line options flags are to be:
o For a single search argument: s arg, eg logparserprosh s POST
o For a double search argument: d arg,arg, eg logparserprosh d POST,
o A z zip option, eg logparserprosh s POST z
Be aware that the z flag cannot be used in the absence of either the s or d flag, ie
logparserprosh z is not valid
When the user chooses the z option, the name of the zip file must be the same as that of the
filtered results csv file, eg resultsfile.csv resultsfile.zip
The output csv file name must be:
o Created and named by the script, and not the user
o Totally unique in every instance, ie a newly created results output file must not overwrite
or clash with an already existing results output file
The number of matching rows is also to be indicated in the terminal output
Importantly, full validation must be applied to all possible user inputs both at the command line and
at the user prompt to ensure that the script does not attempt to commence processing based on
invalid datavalues
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started