Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

sum of array elements bash

read -a array
tot=0
for i in ${array[@]}; do
  let tot+=$i
done
echo "Total: $tot"
Comment

PREVIOUS NEXT
Code Example
Shell :: install ionic cli specific version 
Shell :: login to ssh with password 
Shell :: vim cant open file for writing 
Shell :: mac os generate public key from private key 
Shell :: npm ignore scripts 
Shell :: A multi-stage Dockerfile for building nodejs 
Shell :: uninstall cv2 in pi 
Shell :: git blame before specific commit 
Shell :: retroarch for ubuntu 
Shell :: install node-pre-gyp 
Shell :: install torch anaconda 
Shell :: Sticky notes for Linux(Ubuntu) 
Shell :: echo or cat into multiple files 
Shell :: how to do create diff file in linux 
Shell :: git commit and push command 
Shell :: Unable to create directory wp-content/uploads/. Is its parent directory writable by the server? 
Shell :: how to install ddos on ubuntu 
Shell :: change remote url github 
Shell :: how to assign a letter to a drive 
Shell :: remove git proxy local 
Shell :: pm2 start yarn start 
Shell :: how to remove node modules from github 
Shell :: deactivate laptop keyboard ubuntu 
Shell :: install/uninstall deb packages from linux/ubuntu 
Shell :: how to open chrome on linux mac 
Shell :: linux command for file size 
Shell :: copy ssh key directly window 
Shell :: github repo with most issues 
Shell :: mac check command line tools version 
Shell :: How to install LAMP in CentOs 7? 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =