Difference between revisions of "OPS435 Lab 6 - Bash"

From CDOT Wiki
Jump to: navigation, search
(Created page with 'Write a script that will examine the latest 15 log files, looking for potential attacks on Apache. Specifically: * The files it will examine start with access_log.1, access_log.…')
 
m (Andrew moved page OPS435 Lab 6 to OPS435 Lab 6 - Bash)
 
(No difference)

Latest revision as of 12:31, 22 August 2017

Write a script that will examine the latest 15 log files, looking for potential attacks on Apache. Specifically:

  • The files it will examine start with access_log.1, access_log.2 and end with access_log.15
    • Use a for(()) loop to iterate through all these filenames.
    • If the file contains the string "Access denied" - the name of the file should be added to an array.
  • After your loop finishes - your array will contain the filename of every log file that contains a potential attack.
  • Use another for(()) loop to print all these filenames.

You could solve the problem without for(()) loops and the array but since that's the point of the exercise - please use them.