I have a bash file say input.dat which looks like following.
1 2 4 6
2 3 6 9
3 4 8 12
I want the data in 2nd, 3rd and 4th column to be added and printed in output.dat file like following
1 12
2 18
3 24
How can this be achieved in bash ?