What does $? Do in Bash?

Alvin Le

Member
What does $? Do in Bash?
Answer
$?
expands to the exit status of the most recently executed foreground pipeline. See the Special Parameters section of the Bash manual. In simpler terms, it’s the exit status of the last command.
 

Tìm kiếm

Back
Top