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
bashscr/check_empty_var.txt · Last modified: 23.03.2013 18:25 by eanderalx