Hi,
Here is the output using bash profile on Linux
uptime
04:59:14 up 16 days, 4:48, 2 users, load average: 1.00, 1.00, 1.20
Here is the output using bash profile on Solaris
uptime
4:00am up 84 day(s), 22:21, 3 users, load average: 0.09, 0.10, 0.12
Now, I m looking for a generic command to extract the average CPU Load which is the third column highlighted in BOLD RED
I tried the below command
uptime | awk -F" ," '{print $(NF-2)}' | cut -d ',' -f1
This works fine on Solaris but fails on Linux with the below error
awk: cmd. line:1: (FILENAME=- FNR=1) fatal: attempt to access field -1
Can you please help with a solution ?