Hi Team ,
I wrote a shell script for adding and subtracting two numbers am getting error could some one please help to fix it
script:
echo "Enter 1 to add:"
echo "Enter 2 to sub:"
echo "Enter 3 for both addition and subtraction :"
read ans;
case "$ans" in
1) echo "To add two numbers"
echo "Enter the value of a :" ;;
read a
echo "Enter the value of b:"
read b
adding_numbers
2) echo "To sub two numbers"
echo "Enter the value of a :" ;;
read a
echo "Enter the value of b:"
read b
sub_numbers
3) echo "To perform both addition and Subtraction"
echo "Enter the value of a :" ;;
read a
echo "Enter the value of b:"
read b
adding_numbers & sub_numbers
*) echo "$ans is an invalid option. Choose between 1-2 only" ;
error am getting is:
1
combo.sh: line 33: syntax error near unexpected token `a'
combo.sh: line 33: ` read a'