adding column values on bash

Linux/Bash

  • adding column values on bash 1
paste -sd+ <file> | bc
  • adding column values on bash 2
cat <file> | paste -sd+ | bc