Error with if...elif statemets in linux shell script

Published: 5/10/2017
Error with if...elif statemets in linux shell script
Source: UNIX.STACKEXCHANGE.COM

#!/bin/bash echo "enter your choice :" echo "1 Addition" echo "2 subtract" echo "3 Multiplication" read er echo "enter the first number : " read a echo "enter the second number : " read b if [ $er="1" ] then sum=`expr $a + $b` echo "sum of two numbers is $sum" elif [ $er="2" ] then sub=`expr $a - $b` echo "the diff of two numbers is $sub" exit 0 elif [ $er="3" ] then mult=`ex

Read more
Related news
Comment