“Bash se a variável não estiver vazia” Respostas de código

bash se nulo ou vazio

if [ -z "$variable" ];
  then echo "$variable is null";
  else echo "$variable is not null";
fi
No Name Pro

Bash se a variável não estiver vazia

VAR=`echo Hello world`
if [[ -n "$VAR" ]] ; then echo "Variable is set"  ; fi
if [[ -z "$VAR" ]] ; then echo "Variable is null" ; fi
Annoying Armadillo

Verifique se uma variável é nula em bash

if [[ -n "$list_Data" ]]
then
    echo "not Empty"
else
    echo "empty"
fi
Gifted Gorilla

verifique se a variável está vazia

if [ -z "$var" ] #return true if $var is unset
Armandres

Respostas semelhantes a “Bash se a variável não estiver vazia”

Perguntas semelhantes a “Bash se a variável não estiver vazia”

Mais respostas relacionadas para “Bash se a variável não estiver vazia” em Shell/Bash

Procure respostas de código populares por idioma

Procurar outros idiomas de código