quick question

does anyone know what $? means? i echoed it on my box (running AIX Korn shell) and got 127

It tells about whether the previous command in the shell is success or not.
0 - success

$ jfdfkjd
bash: jfdfkjd: command not found
$ echo $?
127
$ date
Fri Mar 18 03:45:19 CST 2005
$ echo $?
0

Ya, as explained by Bhargav, it gives the return value of the Previous command.
In the above, when you run the jfdfkjd at the prompt, which is not a valid command, the system (shell) fired with command not found...and so when you immediately check $?, it give the return (exit status) of the previous command, and since the value is greater than 0, says that the previous command was an abnormal kind of operation.
Where as next time when data was executed, since its a valid command, it did work fine and hence when you immediately execute $? it return 0 saying that the previuos unix operation was a normal/smooth/perfect operation.

Even you can follow the similar decipline in your programming either C or Shell scripting (use exit 0 in shell script to indicate operationg was smooth else use exit <any greater than zero value> to indicate a failure operation.) This is a good dicipline programming approach.

Small Test, try this..at the command prompt prompt

abcd
echo $?
echo $?
ls
echo $?
echo $?
abcd
echo $?
echo $?
echo $?
-->All the best in your test.