Слишком сложно Только Bash решение
для файла /tmp/file1
1
2
3
4
5
и /tmp/file2
6
7
8
9
10
напишите следующее script.sh
#!/bin/bash
# counters
n=0
m=0
i=0
# read every line from the first file
while read line1;
do
declare firstfile[$n]=$line1
n=$((n+1))
done <$1
# read every line from the second file
while read line2;
do
declare secondfile[$m]=$line2
m=$((m+1))
done <$2
# combine them with arithemtic
while read foo;
do
num=$((${firstfile[$i]} + ${secondfile[$i]}))
echo $num
i=$((i+1))
done <$1
и выполнить его
#:~$ bash script.sh /tmp/file1 /tmp/file2
7
9
11
13
15