Simple arithmetic with
suggest change#!/bin/bash
echo $(( 1 + 2 ))
Output: 3
# Using variables
#!/bin/bash
var1=4
var2=5
((output=$var1 * $var2))
printf "%d\n" "$output"
Output: 20
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents