Mobile app version of vmapp.org
Login or Join
Harper822

: Grep Load Averages I'm trying to grep all load averages & put them in an array. What should be the exact way, keeping in mind the followings requirements. Defining Array: LA= ("one" "five"

@Harper822

Posted in: #LoadTime #Script #Uptime

I'm trying to grep all load averages & put them in an array.
What should be the exact way, keeping in mind the followings requirements.

Defining Array:

LA= ("one" "five" "fifteen")
LA= (`(uptime | grep -o '[0-9]+.[0-9]+*')`)


But this command gives output like this;
3.08
3.49
3.61

Requirement:
1. There should be no linebreaks so the averages are separated with spaces and get fit in array syntax.


Values only before the decimals are sent to output or array variables..


Please if someone can help me achieve it..

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Harper822

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme