Проверьте успех команды Shell
some_command
if [ $? -eq 0 ]; then
echo OK
else
echo FAIL
fi
Nervous Newt
some_command
if [ $? -eq 0 ]; then
echo OK
else
echo FAIL
fi