Created
July 20, 2023 14:09
-
-
Save rafaelmaeuer/a968bbce5f0e13f2df4123710fb29306 to your computer and use it in GitHub Desktop.
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