$ cat text
1
2
3
3
4
5
6
78
9
0
1
2
3
4
576
7
4444
$ cat text | xargs | sed -e 's/\ /+/g' | bc
5148
Fonte: http://stackoverflow.com/questions/450799/shell-command-to-sum-integers-one-per-line
$ cat text
1
2
3
3
4
5
6
78
9
0
1
2
3
4
576
7
4444
$ cat text | xargs | sed -e 's/\ /+/g' | bc
5148
Fonte: http://stackoverflow.com/questions/450799/shell-command-to-sum-integers-one-per-line