fork download
  1. #!/bin/bash
  2.  
  3. cd $(mktemp -d) # so that we can create files in ideone
  4.  
  5. echo "1 11 323
  6. 2 13 3
  7. 3 44 4
  8. 4 66 23
  9. 5 70 23
  10. 6 34 23
  11. 7 24 22
  12. 8 27 5" > input
  13.  
  14. while read -r a b c; do
  15. echo $a $b $c $((a+b+c))
  16. done < input
Success #stdin #stdout 0s 19632KB
stdin
Standard input is empty
stdout
1 11 323 335
2 13 3 18
3 44 4 51
4 66 23 93
5 70 23 98
6 34 23 63
7 24 22 53
8 27 5 40