Grabbin a html code from a page (Var = Curl)

Hi there.

Im not very good on shell yet.

This line, will print me YES or NO in console. Its the HTML code returned from the website, simply YES or NO

curl -L "http://www.thewebsite.net/auth/log.jsp?user=$user&sessionId=$sid&serverId=$hash"

How could i save this into a variable, so i could try something like this:

if [ $response eq "YES" ]
    exit 1
fi
exit 0

I would apreciate any help. Thanx alot.

response=`curl -L "http://www.thewebsite.net/auth/log.jsp?user=$user&sessionId=$sid&serverId=$hash"`

And use double quotes around variables in the test and the right syntax for string comparison and if statement :

if [ "$response" = YES ]; then
...
fi