FreeKB - Bash Shell Scripting Subtraction
Bash Shell Scripting - Subtraction

Here is an example bash shell script that demonstrates how to do subtraction.

#!/bin/bash

x=10
y=2
sum=$((x - y))

echo $sum

 

Running this script should produce the following (the sum of 10 - 2).

8


Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 6547f in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |