sun4lower
3/16/2018 - 9:24 AM

The mean of $?

Expands to the exit status of the most recently executed foreground pipeline.

echo $?

if [$? -eq 0]; then
# do something
else
# do something else
fi