dcsimg
Linux Today: Linux News On Internet Time.




More on LinuxToday


Floating Point Math in Bash, Part 2 (Wait for System Load)

Aug 14, 2008, 19:34 (0 Talkback[s])
(Other stories by Mitch Frazier)

WEBINAR:
On-Demand

Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame


"One slight problem that you'll notice is that the load average values are floating point values. This is where the floating point functions for bash that I wrote about come into play.

"To wait for the load then we only need to extract the relevant value from /proc/loadavg then use float_cond described in the post I mentioned earlier to check if the load is above a certain point and pause if it is. We'll package this all up into its own file wait-for-load.sh so that it can be called from other scripts."

Complete Story

Related Stories: