The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-21-2009
bashshadow1979 bashshadow1979 is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 8
multiple if conditions

Guys, Im trying to have a script that evaluates multiple conditions :


Code:
test.sh:

if [ $1 = "brazil1" ]
then
echo "host $1"
else
if [ $1 = "brazil2" ]
then
echo "host $1"
else
echo $1 not valid
exit 1
fi

when I do

Code:
 ./test.sh brazil1

I get:


Code:
./test.sh: line 12: syntax error: unexpected end of file

I'm not sure what I'm doing wrong, could you give me a hand on it please?

Thanks

Last edited by bashshadow1979; 04-21-2009 at 02:32 PM..