sum column bash code example
Example 1: sum column bash
paste -sd+ infile | bc
# Using existing file
Example 2: sum column bash
<cmd> | paste -sd+ | bc
# Using stdin
paste -sd+ infile | bc
# Using existing file
<cmd> | paste -sd+ | bc
# Using stdin