Created
June 11, 2020 15:09
-
-
Save ProjectOrangeBox/b9f859d9bd657ea0b5ff4bfee8869444 to your computer and use it in GitHub Desktop.
URLs
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
Bash Shell Find Out If a Variable Is Empty Or Not | |
Let us see syntax and examples in details. The syntax is as follows for if command: | |
if [ -z "$var" ] | |
then | |
echo "\$var is empty" | |
else | |
echo "\$var is NOT empty" | |
fi | |
OR | |
if test -z "$var" | |
then | |
echo "\$var is empty" | |
else | |
echo "\$var is NOT empty" | |
fi |
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
BASH / Shell | |
How to Check if a File or Directory Exists in Bash | |
https://linuxize.com/post/bash-check-if-file-exists/#conclusion | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment