In the very beginning of a script stands:
if [ -z $DISPLAY ] then DIALOG=dialog else DIALOG=Xdialog fi
I understand, that
$DISPLAYholds the value of which pseudo-terminal one is attached to
[ -z $DISPLAY ]tests whether $DISPLAY has a value or is an empty string
What is the purpose of
$DISPLAY keeping a value, what is different when it has an empty string?
Why would it be crucial for the further execution of the script to know whether
[ -z $DISPLAY ] is true or false ?