This is to print the sum of all numbers in a file using awk.
If the file which we want to process is sum.txt, and it's content is :
cat sum.txt
1
3
2
4
5
To find the sum of all these numbers we can use below command:
If the file which we want to process is sum.txt, and it's content is :
cat sum.txt
1
3
2
4
5
To find the sum of all these numbers we can use below command: