How would you correctly test the exit status of the previous command in BASH?

You are creating a script with demands that the previous command execute correctly. How would you correctly test the exit status of the previous command in BASH?
A. if [ “$#” -eq “0” ]; then…
B. if [ “$?” -eq “0” ]; then…
C. if [ ‘$#’ == 0 ]; then…
D. if [ ‘$?’ == ‘0’]; then…
E. if [ $@ -eq 0 ]; then…

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.