Q: Which command will print out the exit value of a script that just ran successfully?
or
Q: What command will output a script’s exit value when it has completed successfully?
- wc variables.py
- echo $?
- echo $PATH
- import sys
Explanation: The $? variable in Bash stores the exit status of the execution of the most recent command. It is possible to print out the exit value of the script or command that was currently being performed by using the echo $? command. With a successful execution of the script, the exit value will normally be 0.