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:
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 101Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started