bash negating if code example
Example 1: bash negate if
if [[ $? -ne 0 ]]; then # -ne: not equal
if ! [[ $? -eq 0 ]]; then # -eq: equal
if [[ ! $? -eq 0 ]]; then
Example 2: bash if else if
if [[ TEST-COMMAND ]]
then
STATEMENTS1
else
STATEMENTS2
fi