If Statement

I am working in korn shell ad I have the following problem:

EXPORTALLFIRST=Y

I have an if statement in my program

if [ "${EXPORTALLFIRST}" -eq Y ]
then

and I am getting the following error

export.sh[28]: Y: 0403-009 The specified number is not valid for this command.

Do you see any obvious errors?

-eq is an numeric test. Change to = instead.

thank worked

I'm trying to run a simple If statement, but am getting errors....please advise

#!/bin/bash
echo What is your name?
read name
if $name = Peter
then echo Hey! That is my name, too!
else echo That is not a bad name either.
fi

It doesn't seem to like line 4. How do I tighten that up so that it will work correctly? Thanks, and I realize this really is UNIX child's play. I just don't have anyone else to ask.

You need to use 'test'. The shell itself calls a separate program to do the string comparison. You should probably use quotes too, though you may be able to get by without them.

#!/bin/bash
echo What is your name?
read name
if [ $name = "Peter" ]
then echo Hey! That is my name, too!
else echo That is not a bad name either.
fi

Thanks, buddy. It worked perfectly.