How to add bash command

In this article let’s discuss about How to add bash command. Let’s go through the following methods without any delay.

Method 1:

a=`expr "$a" + "$num"`

a=$(($a+$num))

((a=a+num))

let a=a+num

((a+=num))

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!

Method 2 :

alias yourVariable='cd /Home/yourFolder'

Hope the above solution works.

Realted Posts : How to sum variables shell