Question: Bash programming in linux Write a complete bash script that monitors the number of processes per user on the current CSE Linux machine where the

Bash programming in linux

Write a complete bash script that monitors the number of processes per user on the current CSE Linux machine 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.

**This part I need help: If the user enters a list of user IDs as arguments to the program it should only report processes for those users. Example is shown below:

Bash programming in linux Write a complete bash script that monitors the

This is my current code for that part, Please fill in the missing codes. The output should be like the one above.

for i in $* do echo `date` echo "USER ID Count"

echo "$users USERS,TOTAL PROCESSES $total"

sleep 5 done

$ ./minor2.sh root uuidd WDJ0017 Sun 7 Feb 2021 11:19:06 PM CST User ID Count root 92 wdj 0017 8 uuidd 1 3 USERS, TOTAL PROCESSES 101

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!