I have a command I am using
#cat test |grep "Ongoing Calls" |awk -F' ' '{print $3}'
40
2
As you can see it returns 2 values 40 & 2
I want to now add these together and put into a file as 42
any ideas
edit here is what is in the test file - all I want is the values in OnGoing calls and sumed together
Iedge Group 1
RasIpAddr 0.0.0.0/0
SubnetIP
SubnetMask
Max Calls 50 (0:-1)
Max 911 Overflow Calls 0 (0:0)
Ongoing Calls 2 (0:2)
Ongoing Calls 40 (40:0)
Max Src Hunting 0
Max number of simultaneously allowed transfer calls 0
Ongoing transfer calls 0
Priority 0
Call Duration 0
Idle TCP/TLS/SCTP Connection Timeout 0
Bi-directional TCP/SCTP connections enabled
Capabilities gateway
SIP enabled
H323 disabled
Zone
when I used this command
awk '/Ongoing Calls/ { sum += 3 } END { print sum }' test `
I keep getting the value 3 if there is nothing in the OnGoing calls section