Im currently trying to make a addition command in unix and have come up with the following code:
#! /bin/bash
#! Add - adds two given numbers together and displays the result
"$num1" = $1
"$num2" = $2
echo "Enter two numbers"
read num1 num2
sum=$(“$num1” + “$num2”)
echo "The sum is = $sum"
This however does not work.
num1=$1
. No spaces, and the undecorated name on the left-hand side of the equal sign. Of course, those assignments are unnecessary, because you overwrite their values with the `read1 statement before you ever use them. – chepner Nov 25 '15 at 21:14