I was wondering what would be the best way to check the exit status in an if statement in order to echo a specific output.
I'm thinking of it being
if [ $? -eq 1 ]
then
echo "blah blah blah"
fi
The issue I am also having is that the exit statement is before the if statement simply because it has to have that exit code. Also, I know I'm doing something wrong since the exit would obviously exit the program.