This is the easiest way to check if the last command was succesful in bash.
your_command_to_test if [ $? -eq 0 ]; then echo OK else echo FAIL fi
This is the easiest way to check if the last command was succesful in bash.
your_command_to_test if [ $? -eq 0 ]; then echo OK else echo FAIL fi
© 2021 88plug.
Leave a Reply