Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash calculate sum

#Just use following structure for summing up varibles:
sum=$((var1 + var2))
#For float numbers use next instruction:
sum=$(bc <<< $var1'+'$var2)
Comment

bash sum numbers

num1=1232
num2=24 
num3=444
sum=$((num1+num2+num3))
echo $sum # prints 1700
Comment

PREVIOUS NEXT
Code Example
Shell :: debian mongodb 
Shell :: linux list files in txt 
Shell :: start xampp on mac 
Shell :: how to install rasa in pip 
Shell :: supertest example 
Shell :: aws cli on heroku 
Shell :: vim remove all commented lines 
Shell :: destroy linux with one command 
Shell :: macbook pro mac address 
Shell :: docker auto start when reboot 
Shell :: yarn global 
Shell :: how to log into a remote linux server 
Shell :: add user sudoers arch 
Shell :: bash get domain from url 
Shell :: clone at a given commit github 
Shell :: view file in terminal 
Shell :: error: src refspec master does not match any 
Shell :: How to discard files from stash in git 
Shell :: stop elasticsearch node 
Shell :: enable mods 
Shell :: instal maven in mac brew 
Shell :: what is my ip 
Shell :: bash for loop 
Shell :: django start project in existing directory 
Shell :: gitignore all files and folders in only one folder 
Shell :: removing duplicate input from a file in the command line 
Shell :: rdp github shadow 
Shell :: install spark 2.4.0 on ubuntu 
Shell :: bash get absolute path 
Shell :: print screen in ubuntu to folder 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =