This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -n operator: check if var is not empty | |
VAR="test" | |
if [ -n "$VAR" ]; then | |
echo "$VAR is not empty" | |
fi | |
# -z operator: check if var is empty | |
VAR="" | |
if [ -z "$VAR" ]; then | |
echo "$VAR is empty" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment