Problem Statement
Which variable stores the exit status of the last executed command?
Explanation
The special variable $? holds the exit status of the most recent command.
A value of 0 means success, while any non-zero value indicates an error or failure.
Code Solution
SolutionRead Only
cp file.txt /backup/ echo $?