Skip to main content
added 2 characters in body
Source Link
030
  • 6k
  • 13
  • 69
  • 113

This will return true if a variable is unset or set to the empty string ("").

if [ -z "$VAR""${VAR}" ];

This will return true if a variable is unset or set to the empty string ("").

if [ -z "$VAR" ];

This will return true if a variable is unset or set to the empty string ("").

if [ -z "${VAR}" ];

This will return true if a variable is unset or set to the empty string ("").

if [ -z "$VAR" ];

This will return true if a variable is unset.

if [ -z "$VAR" ];

This will return true if a variable is unset or set to the empty string ("").

if [ -z "$VAR" ];
Source Link
duffbeer703
  • 21.6k
  • 4
  • 32
  • 39

This will return true if a variable is unset.

if [ -z "$VAR" ];