I encountered $? in one of the shell scripts I work on integrating (not written by me).
Just wanted to confirm that it means the return code of the previous command.
The usage is something like
runSomeCommand $VAR1 $VAR2 $VAR3
processResult $?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
$?is the exit status of the last executed command.