How to sum a bash array of numbers (some in scientific notation)?
4
votes
2
answers
7487
views
Since the following command using bc does not work for numbers in scientific notation, I was wondering about an alternative, e.g. using awk?
sum=$( IFS="+"; bc <<< "${arrValues[*]}" )
Asked by MaVe
(339 rep)
Nov 6, 2013, 03:59 PM
Last activity: Jan 18, 2023, 02:12 PM
Last activity: Jan 18, 2023, 02:12 PM