If then else loop in Shell script

Hi

Following is the code . When I give input as Bangalore,its dospalying Welcome to Hitech City. But say , if I select Delhi or US, its not displaying the corresponding message. Its still says Welcome to Hitech City.

Seems that it not entering in the elif part. Please suggest.

#! bin/bash
echo "Enter the name of City from following :Bangalore,Delh,US"
read dist
if [ $dist=Bangalore]
then
echo " Welcome to Hitech City"
elif [ $dist=Delhi ]
then
echo " Welcome to National Capital "
elif [ $dist=US ]
then
tput blink
echo " Well you are trying for US !!! "
else
echo " Please try again from given option only !!!! "
fi

Thanks
Pankaj

Missing space betwen Bangalore and ]

Jean-Pierre.

Hey

Tried with your suggestion too.... Hard Luck ....... Same problem.... Its not entering other elif condition

I think there is some problem with read command . I m nt sure

bye
Pankaj

Introduce a whitespace on either side of =

#! bin/bash
echo "Enter the name of City from following :Bangalore,Delh,US"
read dist
if [ $dist = Bangalore ]
then
echo " Welcome to Hitech City"
elif [ $dist = Delhi ]
then
echo " Welcome to National Capital "
elif [ $dist = US ]
then
tput blink
echo " Well you are trying for US !!! "
else
echo " Please try again from given option only !!!! "
fi

Thanks a lot........ Its working now

Regards

Pankaj