$? stores the exit status of the most recently executed command. A value of 0 indicates success, while non-zero values indicate various error conditions. $$ gives the current shell's PID, $! gives the last background job's PID, and $# gives the argument count.