Question: 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 1-8 inclusive,
write a script that, in addition to the functionality provided by logparser.sh (as developed for Portfolio 2),
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 (3) 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 (3) command line options (flags) are to be:
o For a single search argument: -s arg, e.g., logparserpro.sh -s POST
o For a double search argument: -d arg,arg, e.g., logparserpro.sh -d POST,200
o A -z zip option, e.g. logparserpro.sh -s POST -z
Be aware that the -z flag cannot be used in the absence of either the -s or -d flag, i.e.
logparserpro.sh -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, e.g. results_file.csv -> results_file.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, i.e. 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 data/values

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 Databases Questions!