num1=2;
demonstrates how a numerical value can be assigned to a variable. let
evaluates arithmetic expressions. The sum of both variables is assigned to a new variable named result
.
#!/bin/bashnum1=2;
num2=3;let result=num1+num2
echo $result
The script above prints:
5