Comparing a String variable with a string literal in a Debian shell script

Hi All,

I am trying to to compare a string variable with a string literal inside a loop but keep getting the

./testifstructure.sh: line 6: [{BOOK1}: command not found
2

Please can anyone offer any advise.

Many thanks for your help

This is the test CODE follows:

#!/bin/sh
BOOK_LIST="BOOK1 BOOK2"

for BOOK in ${BOOK_LIST}
do
 if [{$BOOK} = "BOOK1"]
 then echo '1'
 else
      echo '2'
  fi

done

 if [ "$BOOK" = "BOOK1" ] 

Be careful, recpect the needed spaces for the square brackets...

I would put a

 read KYB 

so you have to press a key to continue after the fi so that you see where you are... (end on loop first /secand pass) othewise it is going to display 1 and 2 without you knowing where from...