Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Shell/Bash
sum of array elements bash
Ellen68
Programming language:
Shell/Bash
2021-05-14 05:23:40
0
Q:
sum of array elements bash
RORI
Code:
Shell/Bash
2021-02-25 02:07:55
read -a array tot=0 for i in ${array[@]}; do let tot+=$i done echo "Total: $tot"
0
Tags
array
element
sum
Related
bash sum float numbers
bash sum variable
bash sum floating point numbers
New to Communities?
Join the community