Multi Line:
if [[ $INSTALLED != "yes" ]]; then
echo "Error message."
fi
Code language: Bash (bash)
if [[ $INSTALLED != "yes" ]]; then
echo "Error message."
else
echo "Message."
fi
Code language: Bash (bash)
One Line:
if [[ $INSTALLED != "yes" ]];then echo "Error message."; fi
Code language: Bash (bash)
if [[ $INSTALLED != "yes" ]];then echo "Error message."; else echo "Message."; fi
Code language: Bash (bash)
Another One Line Method:
[[ $INSTALLED != "yes" ]] && echo "Error message." || sleep 0
Code language: Bash (bash)
[[ $INSTALLED != "yes" ]] && echo "Error message." || echo "Message."
Code language: Bash (bash)
Leave a Reply