Reputation: 69
read command;
if[ $command = "make"]
then
echo "Hello"
elif[ $command = "make run"]
then
echo "Goodbye"
fi
I have looked at similar questions and their solutions are not helping here.
Upvotes: 1
Views: 109
Reputation: 1100
You need to respect spaces in bash scripts like @Jonny Henly said. Here is a modified version of your code, try it and see if it works.
read command;
if [ $command = "make" ]
then
echo "Hello"
elif [ $command = "make run" ]
then
echo "Goodbye"
fi
Hope it helps.
Upvotes: 4