Linux, Virtualization and whatever I find interesting ...

User Tools

Site Tools


Check for empty variables

  • If you want to check for a empty bash variable you can do this like given here:

# if VAR is empty
if [ "x$VAR" == "x" ];then
  • When $VAR is empty the Statement in the if-clause is true
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
bashscr/check_empty_var.txt · Last modified: 23.03.2013 18:25 by eanderalx