Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Each student will write a Bash script which provides information to the user comparing the statuses of processes and or threads. The specific information to
Each student will write a Bash script which provides information to the user comparing the statuses of processes and or threads.
The specific information to be provided to the user will be determined by the student, but must include at least three different values.
The script will use the information from the proc directory to provide the output.
The script will support multiple uses, which will include a help option which will display basic usage information.
Some examples of comparisons the script may perform:
Display the two processes most nearly identical in terms of runtime, memory size, etc.
Display the processes which closely match specific input parameters for process attributes.
Display processes which were launched from a particular directory or directory tree, or which were launched from similar locations.
Display processes in adjacent or nearly adjacent memory locations.
Display processes where Usernames have matching characteristics.
Create an ongoing list of all process names which have been used on the system.
The script must allow for and use at least command line arguments in addition to help
The command line arguments may either be used as a part of the determination eg user or dates
Or to change the behavior of the script eg count remote vrs local access
The script must include at least one function.
The script will follow the Scripting Best Practices as provided.
When run with inappropriate arguments, scripts should print a usage message and exit. The same message could be printed with a help argument.
Validate inputs and sanity check derived values.
Return an appropriate exit code: zero for success and nonzero for failure.
Use appropriate naming conventions for variables, scripts, and routines.
User variable names that reflect the values they store.
Start every script with a comment block that tells what the script does and what parameters it takes. Include your name and the date. If the script requires nonstandard tools, libraries, or modules to be installed, list those as well.
Comment at a useful level. More complexity requires more comments.
Error messages should:
Go to STDERR, not STDOUT.
Include the name of the program thats issuing the error.
State the function of operation that failed.
If a system call fails, include the perror string.
Exit with a code other than
Step 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