The take-home part of the Midterm Exam is due on Tuesday, April 4 (the Tuesday after Spring Break).
Create the following bash scripts. The scripts should use pipelines of common UNIX commands. No explicit bash loops of any kind are to be used. The command used must be clearly written so that it can be executed at any place in the filesystem of cs480student??.uakron.edu. They are to be installed in /usr/local/bin on your server.
Investigate the work of the Linux kernel and the contribution of Linus Torvalds.
Take a directory of source code and produces a code-summarization report in the Markdown format:
# Code Summary * Directory: /usr/include * Files: 1,701 * LOC: 452,159 * if: ? * while: ? * for: ? * do while: ? * switch: ? * case: ? * expression statements: ? * variable declarations: ? * structs: ? * function calls: ? * functions: ? * function definitions: ?
where ? is replaced by the actual number, and the results are ordered by frequency, from most used to least used.
time srcml --verbose <directory/file> -o <output_filename>
For example, to store the srcML of /usr/include, the command would be:
time srcml --verbose /usr/include -o report.xml
A couple of hints:
Write a bash script called xml2text that converts an XML document back to text. This means that it removes all XML tags and markup, but leaves the text and whitespace. This would be to remove:
Write this using sed and regular expressions.
The In-Class part of the Midterm Exam is on Thursday, March 23 (Thursday before Spring Break). It is worth 50% of your Midterm grade. You will be responsible for:
Teaching Assistant: Ms. Ananya Vaka email@example.com
Textbook: UNIX Power Tools 3rd Edition by Powers, Peek, O’Reilly, and Loukides. UANet
Textbook: UNIX Systems Programming: Communication, Concurrency, and Threads 2nd Edition (2015) by Robbins, and Robbins. UANet Note: Link is to 1st Edition