Home | | | Syllabus | | | Schedule | | | Class Notes | | | Assignments |
Assignment goal: To input a log file file and present a summary of data from the file.
Assignment structure: Write one Perl program that reads input from a log file (available here as lastlog.txt). Parse that input into fields, using appropriate variables or data structures to store them. Provide a summary analysis of the log file including: number of entries; earliest & latest data; total time logged in per user; and total logged in time overall plus average time logged in per day
Required input and output: Prof. Newby will supply a log input file from the Unix/Linux last command. Input the file to your program using a file open command or similar technique. Output is the summary analysis mentioned above.
Input format: man last and man utmp for more information about the "last" logfile format. Fields are fixed length. Fields are:
Further work: Optionally, you could supply additional summary information from the log file. Optionally, you could prompt the user for what summary information to provide, or a range of dates or other values to select from.
Deliverables: Send email to Prof. Newby with two attachments. First is your Perl program. Second is a plain text file showing a sample run of the program.
Grading: 10 points for required functionality, plus up to 2 points for extra functionality, as follows:
Criterion | Max. Points | Description |
Functionality | 6 | Meets assignment I/O requirements |
Legibility | 2 | Includes comments; neatly written |
Parsimony | 2 | Uses appropriate data structures and syntax; not overly complex or convoluted |
Extra work | 2 | Functionality demonstrating clear understanding beyond the assignment requirements |