πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!


    Question

    How do you check the exit status of the last executed

    command in a shell?
    A $? Correct Answer Incorrect Answer
    B $! Correct Answer Incorrect Answer
    C $0 Correct Answer Incorrect Answer
    D $# Correct Answer Incorrect Answer
    E $$ Correct Answer Incorrect Answer

    Solution

    $? returns the exit status (0 for success, non-zero for failure) of the last command.

    Practice Next
    More Shell Scripting Questions
    ask-question