Question: SCRIPT DESCRIPTION: Write a complete bash script that monitors the number of processes per user on the current CSE Linux machine (e.g., cse01, cse02, etc.)

 SCRIPT DESCRIPTION: Write a complete bash script that monitors the number

SCRIPT DESCRIPTION: Write a complete bash script that monitors the number of processes per user on the current CSE Linux machine (e.g., cse01, cse02, etc.) where the script is running. In particular, you will count all processes and total them per user every 5 seconds and report each user ID with the number of processes running during that time frame. Note this will include system processes. If the user enters a list of user IDs as arguments to the program it should only report processes for those users. In addition, you will install a custom signal handler to trap the SIGINT (.e., C). This signal handler should prompt the user if they really want to exit. If they enter "Y" or "y", your program should exit. If anything else is entered, the program should continue to run. You will also print out the current date and time, a heading before listing the users and process count followed by a line containing the total number of users and total number of processes running. The users column and the counts should line up to look nice. Add a blank line between each output to make it easier to see each report. The output of each line Please see the SAMPLE OUTPUT for several examples, including the different scenarios that might occur. REQUIREMENTS: Your script should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date, and brief description), comments for each variable, and commented blocks of code. Your bash script should be named "minor2.sh", without the quotes. Note that this must be done as a bash script, not a C program. Your script will be graded based largely on whether it works correctly on the CSE machines (e.g., cse01, cse02, ..., cse06), so you should make sure that your script runs on a CSE machine. Please pay attention to the SAMPLE OUTPUT for how this script is expected to work. If you have any questions about this, please contact your instructor or TAS assigned to this course to ensure you understand these directions. This is an individual programming assignment that must be the sole work of the individual student. Any instance of academic dishonesty will result in a grade of "F" for the course, along with a report filed into the Academic Integrity Database . . 1

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!