$?
is a variable holding the return value of the last command you ran.
Example C program (example.c
):
int main() { return 1; }
Example Bash:
gcc -o example example.c
./example
echo $? # prints 1
$?
is a variable holding the return value of the last command you ran.
Example C program (example.c
):
int main() { return 1; }
Example Bash:
gcc -o example example.c
./example
echo $? # prints 1