Link to home
Start Free TrialLog in
Avatar of everactive
everactive

asked on

While load average > 2...

Hello,

How can I have this loop in shell:

while this minute load average is bigger than 2.0, execute the code within the loop.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tintin
Tintin

vikas, please note there are a number of problems with your suggestion


1.  Invalid syntax due to spaces before the =

2.  The cut doesn't extract the 1 min average

3.  Even if the cut was correct, the while loop would still run if the average was between 2.01 and 2.99, which it shouldn't