Solution 1
#!/bin/bash
{ read -ra line1; read _; read -ra line3; }
for i in "${!line1[@]}"; do
result+=("$(( ${line1[i]} + ${line3[i]} ))")
done
printf %s\\n "${result[*]}"
Example:
$ bash script < yourfilename
12 14 16 18 20
$
Script explanation
{ read -ra line1; read _; read -ra line3; }
This part reads the first three lines of the file, keeping only the first two lines. It also splits them into arrays line1 and line3.
It assumes a stream of data from stdin. See the example on how to do that.
for i in "${!line1[@]}"; do result+=("$(( ${line1[i]} + ${line3[i]} ))"); done
This part loops over the elements of one of the two arrays, and sums the same elements from line1 and line2. The results are put into a new array called result
printf %s\\n "${result[*]}"
Prints the computed array elements space-separated.
Solution 2
Another solution avoiding loops, assuming the input has 5 columns as requested:
#!/bin/bash
{ read a b c d e; read _; read v w x y z; }
echo "$((a+v)) $((b+w)) $((c+x)) $((d+y)) $((e+z))"
Example:
$ cat yourfilename
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
...
$ bash script < yourfilename
12 14 16 18 20
$
Script explanation
{ read a b c d e; read _; read v w x y z; }
Reads the numbers from line 1 (resp. line 3) into variables a to e (resp. v to z)
echo "$((a+v)) $((b+w)) $((c+x)) $((d+y)) $((e+z))"
Prints the sum of the variables space-separated as requested