When defining variables, don't leave spaces between the variable name the equal sign and the value. On my box top is missing a value for -n. Also when using a range with cut, leave spaces out too. You should work on the single commands first so that they work and then put them together.
c = $((top -b -n | grep Cpu | cut -c 35 - 39))
^ ^ ^ ^ ^
| | | | |
Delete those.. | ..spaces, they are wrong!
|
Missing a value here
So :rolleyes: I need to sum c1+c2+c3 = c (need to get CPU total usage ), that variable c i want to use in different if statements (if test $c -lt 10; then). When i try to use c=$(($c1+$c2)) it gives me error (if i use just c=$(($11+$11)) it works). It means, that c1 and c2 are not integer values? So how can i fix it?
... makes no sense to me. $ is beginning character of a variable. There are positional variables/parameters but you are not using $11 from your examples so I guess it is a typo.
Are you sure you wanted to award me 50k bits and are now in minus with your bits account?