Search Results

Search: Posts Made By: qdf
6,284
Posted By qdf
c1=$(top -b -n 1| grep Cpu | cut -c 35-39) echo...
c1=$(top -b -n 1| grep Cpu | cut -c 35-39)
echo $c1
93.7

c2=$(top -b -n 1| grep Cpu | cut -c 9-12)
echo $c2
0.2

c3=$(top -b -n 1| grep Cpu | cut -c 19-21)
echo $c3
0.1


So :rolleyes: ...
6,284
Posted By qdf
echo `top -b -n 1| grep Cpu| cut -c35-39` + 1|...
echo `top -b -n 1| grep Cpu| cut -c35-39` + 1| bc -l| read tvar
echo $tvar


gives error message illegal character |


echo $( top -b -n 1| grep Cpu| cut -c35-39 ) + 1| bc -l| read tvar...
6,284
Posted By qdf
c=$((top -b -n 1| grep Cpu | cut -c 35-39)) ...
c=$((top -b -n 1| grep Cpu | cut -c 35-39))


gives the same error message...


arithmetic expression: expecting EOF: "top -b -n 1| grep Cpu | cut -c 35-39"
6,284
Posted By qdf
How to sum values from top
Hi.
Im looking for way to sum numbers from top. For example i have such command

top -b -n | grep Cpu | cut -c 35 - 39

which give me output 97.0 . Ho can i do with that value any arithmetic...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 06:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy