Skip to content

Instantly share code, notes, and snippets.

@jkereako
Created March 10, 2018 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkereako/39886ac2743c2a8418e8d6660568a668 to your computer and use it in GitHub Desktop.
Save jkereako/39886ac2743c2a8418e8d6660568a668 to your computer and use it in GitHub Desktop.
Add all values in a file.
# Concatenate all lines into 1 line delimited by a "+" and pipe the input into bc
# Example: 178.91+143.39+145.433
paste -sd+ electric_bills.txt | bc
178.91
143.39
145.433
122.36
96.15
109.59
120.56
115.41
101.88
98.27
135.13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment