load average command

hello there,
im running this in linux server but i cant run it on freebsd.
linux command doesnt work on freebsd so i have to use sysctl vm.loadavg instead..

*********linux system**********
[(01:37 PM)][(root@dedicated)] [(~)] $ cat /proc/loadavg
2.73 2.51 2.24 3/195 16583
[(01:37 PM)][(root@dedicated)] [(~)] $ uptime
 13:37:31 up 4 days,  2:28,  1 user,  load average: 2.73, 2.51, 2.24
[(01:37 PM)][(root@dedicated)] [(~)] $ cat /proc/loadavg | cut -d ' ' -f2 | sed 's/\.//g' | sed 's/^0//g'
251
[(01:37 PM)][(root@dedicated)] [(~)] $ cat /proc/loadavg | cut -d ' ' -f3 | sed 's/\.//g' | sed 's/^0//g'
224
*****************************

$ sysctl vm.loadavg
vm.loadavg: { 0.09 0.27 0.38 }

then doing this
$ sysctl vm.loadavg | cut -d ' ' -f3 | sed 's/\.//g' | sed 's/^0//g'
09

the 09 its supposed to be 009

then
$ sysctl vm.loadavg | cut -d ' ' -f2 | sed 's/\.//g' | sed 's/^0//g'
{

all im trying to do is show the same as linux
if [ "$TYPE" = "load" ]; then
INDATA=`cat /proc/loadavg | cut -d ' ' -f2 | sed 's/\.//g' | sed 's/^0//g'`
OUTDATA=`cat /proc/loadavg | cut -d ' ' -f3 | sed 's/\.//g' | sed 's/^0//g'`
fi

Open in new window

LVL 1
XK8ERAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TeRReFCommented:
$ sysctl vm.loadavg
vm.loadavg: { 0.09 0.27 0.38 }

$ sysctl vm.loadavg | cut -d ' ' -f 3 | sed 's/\.//g'
009

$ sysctl vm.loadavg | cut -d ' ' -f 4 | sed 's/\.//g'
027

$ sysctl vm.loadavg | cut -d ' ' -f 5 | sed 's/\.//g'
038

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.