variable assigment not works in shell script

Hi,
The following assigment is not working within shell script but is working from command line. Could anybody advise why? OS - solaris 8

APPL=`grep "$Application" ldapapps |awk '{print $1}'`
echo $APPL

Not quite sure, but try using the full path for grep, like

/usr/bin/grep

and see what happens.

APPL=`grep "$Application" ldapapps |awk '{print $1}'`
echo $APPL

Is ldapapps a variable. If it is then it should be represented by ${ldapapps}.

ldappapps is a simple plaintext file.
Any suggestions?

What means "does not work"? I guess you get nothing displayed or do you get an error..?

As you say that it works on the command line, please show the output of it, thanks.

Is $Application set in the script you are trying the variable assignment in?

Did you set the variable $Application ?
Is the variable with a capital A?
did you spell correctly? ldapapps vs. ldappapps