Script returning an error message on exiting

Hi,

I am writing a script in which I am using an IF-Else statement.

Code sample:

 
# Check for the product.
  If (test "$3" = "Pet") Then
     Product_Code="PI"
  elif (test "$3" = "Breakdown") Then
     Product_Code="RI"
  elif (test "$3" = "Travel") Then
     Product_Code="TI"
  elif (test "$3" = "Dental & Health") Then
     Product_Code="DI"
  elif (test "$3" = "FRIENDS PROVIDENT LIFE") Then
     Product_Code="LI"
  elif (test "$3" = "LIFE 2") Then
     Product_Code="OF"
  elif (test "$3" = "Aviva Life") Then
     Product_Code="LI"
  elif (test "$3" = "Direct Line Life") Then
     Product_Code="LI"
  echo 'Not a valid Product'
  exit 1;
  fi

Please correct me if anything is wrong. Now I want to exit out if I don't have any matching condition and print the message 'Not a valid Product'
on the prompt.
I have more statements to follow if any of the condition matches.

Please suggest me.

You might want to do this with case/esac. That's more tidy and less to write.

there is a mistake in the code

elif (test "$3" = "Direct Line Life") Then
     Product_Code="LI"
else
  echo 'Not a valid Product'
  exit 1;
fi

and try to implement case rather than else-if...