Horje
bash check if variable is empty Code Example
bash if null or empty
if [ -z "$variable" ];
  then echo "$variable is null";
  else echo "$variable is not null";
fi
bash if variable is not empty
VAR=`echo Hello world`
if [[ -n "$VAR" ]] ; then echo "Variable is set"  ; fi
if [[ -z "$VAR" ]] ; then echo "Variable is null" ; fi
bash check if variable is empty
if [ -z "$var" ] #return true if $var is unset




Shell

Related
gnu octave ubuntu 20.04 Code Example gnu octave ubuntu 20.04 Code Example
linux move all files up a directory Code Example linux move all files up a directory Code Example
switch npm versions Code Example switch npm versions Code Example
kill all processes by name cmd Code Example kill all processes by name cmd Code Example
How do I compile a java file that has jar dependencies? Code Example How do I compile a java file that has jar dependencies? Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8