Help regarding Error message: A test command parameter is not valid

Hi

I am getting few messages when trying to run my script from the following lines in the script

    if test [ $COLNAME -eq "BUCH_DAT" ]
    then
 // SomeCode
    fi 

The messages are as follows:

testing.sh[123]: OBLIGOR_GROUP_ID: 0403-012 A test command parameter is not valid.
testing.sh[123]: LFD_NR_B2USG: 0403-012 A test command parameter is not valid.
testing.sh[123]: TAB_ID: 0403-012 A test command parameter is not valid.
testing.sh[123]: LOAD_TIMESTAMP: 0403-012 A test command parameter is not valid.
testing.sh[123]: BUCH_DAT: 0403-012 A test command parameter is not valid.

I guess these are b'coz of some syntax problem.

Kindly correct me.

Thanks

eq is used for numerical comparison

if test [ $COLNAME = "BUCH_DAT" ]

Even now i am getting these messages

testing.sh[123]: COLNAME: 0403-012 A test command parameter is not valid.
0403-012 A test command parameter is not valid.
testing.sh[123]: OBLIGOR_GROUP_ID: 0403-012 A test command parameter is not valid.
testing.sh[123]: LFD_NR_B2USG: 0403-012 A test command parameter is not valid.
testing.sh[123]: TAB_ID: 0403-012 A test command parameter is not valid.

There are few more messages like this from the following code :

if [ $FLAG -eq 0 ] && [ $COLNAME != "LFD_NR_B2USG" ] && [ $counter -ge 4 ]
then
TECHNICAL_ID=$TECHNICAL_ID" "$COLNAME
fi
if [ $COLNAME = "LFD_NR_B2USG" ]
then
echo "LADE_NR INTEGER NOT NULL ,">>$DDL_DIRECTORY/$DDL_FILENAME
FLAG=1
fi
The messages are

testing.sh[113]: test: 0403-004 Specify a parameter with this command.
testing.sh[117]: test: 0403-004 Specify a parameter with this command.
testing.sh[127]: test: 0403-004 Specify a parameter with this command.

if [ "$FLAG" -eq 0 ] && [ "$COLNAME" != "LFD_NR_B2USG" ] && [ "$counter" -ge 4 ]
then
   TECHNICAL_ID=$TECHNICAL_ID" "$COLNAME
fi
if [ "$COLNAME" = "LFD_NR_B2USG" ]
then
   echo "LADE_NR INTEGER NOT NULL ,">>$DDL_DIRECTORY/$DDL_FILENAME
   FLAG=1
fi

Thanks Aigles

This solves the messages.

it is safest to always enclose parameters in quotes,
if they are null the test then will not fail

[ "$this" -eq "$that" ]