Community Page
- www.tech-recipes.com/ Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- i wish south africans would start getting twiter after all we are hosting the 2010 world cup so the world must start acepting it
- ñ digam!! remover ie8 no adicionar e remover programas ??? eu nunca teria pensado nisso!! bando d otários!!
- it wont work help me
- it dosnt bring up the flash player wizard can u help please
- Google is the best search engine...what else I can say? But I dont use google chrome, I prefer other browser
Tech-Recipes
Cookbook of Tech TutorialsBourne/bash shell scripts: string comparison | Bourne shell scripting | Tech-Recipes
Started by qdideas · 9 months ago
5 years ago
if [ -z $var ];then
echo null
fi
8 months ago
if [ -z "$var" ];then
echo null
fi
Best Regards,
Kibokina
5 years ago
if [ $var == "" ] ......
because if the variable $var is empty the test is
if [ == "" ] and gives an error
you are obliged to quote the var :
if [ "$var" == "" ] ...
Sergio
4 years ago
s1 = "as"
s2 = "bs"
if test $s1 == $s2
then
echo s1 and s2 are equal
fi
3 months ago
then
echo not the same
fi
3 months ago
2 months ago
if [ "X${VAR}" = "X" ]; then
echo "Empty string"
fi
Testing for equality follows the same logic but without X.