QuestionQ68Verified/Shells y scriptsCopy linkReport a problemAsk AstroTutorSave questionWhat information does the echo $? command display?AThe process ID of the echo command.BThe exit value of the command executed immediately before echo.CThe process ID which will be used for the next command.DThe exit value of the echo command.EThe process ID of the current shell.Show AnswerAnswerExplanationIn a shell, $? contains the exit status of the command executed immediately before the current command. Therefore, echo $? prints that preceding command’s exit value.Show comments2Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion