um, I have no idea what output you were expecting.
You have the third line commented out. Remove the "#" ?
$? is a test of the return value of the last operation. It's a boolean 1 or 0.
If grep succeeds, it returns 0, if it doesn't find the expression, it returns 1.
Also, I usually enclose all test variables in double quotes:
if [ "$?" = "1" ]; then
To avoid confusion (if the variable you're testing for doesn't exist, you'll get errors. The double quotes is the "safe" way to test).
And finally, you can pipe grep's output to /dev/null, so it doesn't clutter up your output, unless you want it there.