trying to sum elements in an array using bc and getopt,i have a file with names and thier vaules if the names appears 3 times i should multiply its value with 3 then find the sum of all the elements together
cat foo.txt
max 2.3
henry 3
fransis 4.5
max 2.3
henry 3
max 2.3
it should show on the terminal
max 6.9
henry 6
fransis 4.5
and so on
---------- Post updated at 01:04 AM ---------- Previous update was at 01:03 AM ----------
im trying not to use awk