$? variable in linux


$? Sta­tus of the pre­vi­ous process / com­mand which ran on the shell

$ pwd
$ echo $? // returns 0 which means the previous command ran sucessfully

$ blahCommand
$echo $? // returns 1 which means the previous command failed

This is very handy to see the sta­tus of the process while work­ing with Jenk­ins.
You can see what was the sta­tus of the pre­vi­ous process and based on that you can continue.


You may also like...