Which of the following will be the script’s output?

A script set to run using /bin/sh has executed a grep command, and grep has returned an error. If the grep result is analyzed by the following logic:

if [ "$?" = 0 ]
then
echo BLUE
else echo GREEN
fi

Which of the following will be the script’s output?

A script set to run using /bin/sh has executed a grep command, and grep has returned an error. If the grep result is analyzed by the following logic:

if [ "$?" = 0 ]
then
echo BLUE
else echo GREEN
fi

Which of the following will be the script’s output?

A.
Error: Unexpected input "$"

B.
BLUE

C.
GREEN

D.
end



Leave a Reply 1

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


mr_tienvu

mr_tienvu

I have the same idea. C