Question
Create a bash script enhancing the file named 'script1' to do these items: Require the script to now use (2) parameters that are passed in.
Create a bash script enhancing the file named 'script1' to do these items:
Require the script to now use (2) parameters that are passed in. Check for the number of parameters passed in and if it is not 2, display an error message and exit. The second parameter will represent a value for the minimum amount of available memory (IE: 200000). Parse the output from the vmstat or free command for the amount of free memory. Lets call this the free_value. Compare free_value to the value passed in for parameter 2. If free_value is less than parameter 2 issue a warning message that will be written to ~/systemlog.
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