I'm using a new language, I think it's linux but to be honest I have no clue; we're connecting to some server through a program called putty to do this programming. As part of an assignment I have to create a calculator program that takes two numbers and an operator as arugments but I'm getting a bunch of unexpected token errors. I'm very lost and neither my text no my professor is helpful so far
#!/bin/bash
function add {
echo $(( $1 + $2 ))
}
function subtract {
echo $(( $1 - $2 ))
}
function multiply {
echo $(( $1 x $2 ))
}
function divide {
echo $(( $1 / $2 ))
}
if [ $3 = '+' ] then add
so far I'm just trying to get it so I can get 2 from the command ./calc.sh 1 1 + but I keep getting unexpected token error on line 20 syntax error near unexpected token 'elif' [ $3 = '-' ]
then subtract