There might be better way to do this, but what springs to mind would something like
Code:
file1=$(tail -n 1 /tmp/file1.dat); file1=$(echo ${file1:1:1})
file2=$(tail -n 1 /tmp/file2.dat); file2=$(echo ${file2:1:1})
file3=$(tail -n 1 /tmp/file3.dat); file3=$(echo ${file3:1:1})
result=$(expr $file1 + $file2 + $file3)
echo $result
tail -n 1 file #would get the last line of a file
echo ${var:1:1} #would extract characters at position:length var is the string, the first 1 is the position and the second 1 is the length.
Like I said there could be a better way to do this.
JC