Finding the sum of two numbers

cat *.out |grep "<some text>" | awk '{print $6}'

For ex,This will reutrn me

11111
22222

is it possible to add these two numbers in the above given command itself?I can write this to a file and find the sum.
But I prefer to this calculation in the above given line itself.

Any suggestions?

Yes is possible but you should post a sample of your .out file and maybe we can provide a solution that don't use cat/grep/awk .

Are you looking for something like this?

awk '/<some text>/{s+=$6}END{print s}' *.out

At a first glance, you can already

grep 'pattern' *.out

(Useless Use of Cat Award) :slight_smile: