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 :: Cache Your Login Credentials 
Shell :: pyinstaller not found 
Shell :: git delete branch 
Shell :: how to copy ssh key 
Shell :: linux run apk 
Shell :: scp download file 
Shell :: install nvm via npm 
Shell :: ubuntu mouse mover 
Shell :: getting started with git 
Shell :: boot repair linux 
Shell :: linux local bin add to path 
Shell :: add role to node kubernetes 
Shell :: git stash unstage cahnges 
Shell :: git command create new branch from current and move changes 
Shell :: how to exit telnet linux 
Shell :: bootstrap 5 react npm 
Shell :: install bpytop 
Shell :: how to uninitialize git 
Shell :: install cpanm 
Shell :: kill tensorboard process 
Shell :: docker for elixir 
Shell :: search for files in linux terminal 
Shell :: wget from text file 
Shell :: ubuntu shell touch multiple files 
Shell :: git checkout branch from remote to local 
Shell :: _csv.Error: line contains NULL byte 
Shell :: git remove remote file keep local 
Shell :: make mp4 smaller using ffmpeg 
Shell :: how to update google chrome in ubuntu 20.04 
Shell :: realtek rtl8812au ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =