I am attempting to find the sum of a list of numbers' reciprocals. To illustrate what I am trying to do, here's a basic example:
With the file:
1
2
3
4
I would be trying to find the sum of 1/1
, 1/2
, 1/3
and 1/4
. Is there a simple bash
one-liner to do this? (I am new to bash
, so explanations would be welcome!)