I am trying to make a menu for a BASH app, and getting an error with 'fi'
This is the code:
chmod u x main.sh
menu() {
clear
echo 1. Option A
echo 2. Option B
read input
if [ $input == "1" ] ;
then
a()
fi
if [ $input == "2" ] ;
then
b()
fi
}
a(){
#code
}
b(){
#code
}
menu
I have made sure I put spaces around brackets, then on a new line, and added semicolons I really don't know why this it's doing this, any help would be greatly appreciated.
CodePudding user response:
In bash, the function call syntax doesn't use the parentheses:
a # not a()!