Which command will print the exit value of the previous command to the screen in bash?
A.
echo $?
B.
echo $#
C.
echo $exit
D.
echo $status
E.
echo $&
Explanation:
There are quite a few internal variables used in bash: see http://tldp.org/LDP/abs/html/internalvariables.htmlSome of them are:
$! PID of last job run in background
$? Exit status of a command, function, or the script itself (see Example 24-7)
$$ PID of the script/process itself.