lundi 22 mars 2021

What is the difference between ! [ -z ${var} ] and [ ! -z ${var} ] [duplicate]

I tend to come accross the two art of IF statements but fail to determine the real difference bewteen the two.

Between

if ! [ -z ${var} ]; then 
  echo "$var is set"
fi



 And


if [ ! ${var} ]; then
  echo "variable string is greater than zero"
fi

Aucun commentaire:

Enregistrer un commentaire