Hi All,
I need to add up values given by the grep command.Following is the sample:
Code:
[root@iqmango ~]# grep cores /proc/cpuinfo
cpu cores : 4
cpu cores : 4
cpu cores : 4
cpu cores : 4
cpu cores : 4
cpu cores : 4
cpu cores : 4
cpu cores : 4
I can do this using a for loop , but wanted to know if this could be done in one line to make the code elegant, maybe using awk or some other tool.
Thanks!
nua7