String compare in shell script

Iam trying to compare the string in if else... but some how its not working

following is the code

On executing the above one its giving a error message ': bad number'

in the above parameter l & k are numbers and dbfiles and patchefiles are array

If i do echo ift working fine

echo ${dbfiles[$l]}

Iam trying to compare strings in array... any help on how it can be done.

Hi,

-eq is meant to compare numbers. Try "=" or "=~" depending on what you
want to achieve. For further information:

man test

HTH Chris

Thx it worked.